Narendra Modi was sworn in as India’s prime minister on Sunday for a record-equalling third term, but as a restive coalition’s head after a shock poll setback that will test his ability to ensure policy certainty in the world’s most populous nation.

President Droupadi Murmu administered the oath of office to Modi at a grand ceremony at the Rashtrapati Bhavan, the president’s palace in New Delhi, attended by thousands of dignitaries, including the leaders of seven regional countries, Bollywood stars and industrialists.

Modi, who started as a publicist of the Hindu nationalist Rashtriya Swayamsevak Sangh (RSS), the ideological parent of his Bharatiya Janata Party (BJP), is only the second person after independence leader Jawaharlal Nehru to serve a third straight term as prime minister.

Modi, 73, secured the third term in elections that concluded on June 1 with the support of 14 regional parties in his BJP-led National Democratic Alliance (NDA), unlike in the previous two terms when his party won an outright majority.

The outcome is seen as a big setback to the popular leader as surveys and exit polls had predicted BJP would secure even more seats than in 2019.

Modi delivered world beating growth and lifted India’s global standing but appeared to have missed a step at home as a lack of enough jobs, high prices, low incomes and religious faultlines pushed voters to rein him in.

When Modi was the chief minister of the western state of Gujarat from 2001 to 2014, BJP enjoyed strong majorities, allowing him to govern decisively.

Modi’s new term as prime minister, therefore, is likely to be fraught with challenges on building consensus on contentious political and policy issues in the face of different interests of regional parties and a stronger opposition, analysts say.

Some analysts worry that the fiscal balance in the world’s fastest growing economy could also come under pressure due to demands for higher development funds for states ruled by the NDA’s regional partners and a possible push by BJP to spend more on welfare to woo back voters it lost in this year’s election.

Modi, whose election campaign was marked by religious rhetoric and criticism of the opposition for allegedly favouring India’s 200 million minority Muslims, has adopted a more conciliatory tone since the shock result.

“We have won the majority … but to run the country it is unanimity that is crucial … we will strive for unanimity,” he said on Friday after the NDA formally named him coalition head.