Indonesia’s President Joko Widodo was sworn in for a second term on Sunday, as the country faces violent attacks led by extremist groups who tried to assassinate his top security minister. Foreign heads of state, lawmakers and political rivals looked attended the swearing-in ceremony of Widodo, 58, and Vice President Ma’ruf Amin, 76, who start a five-year tenure leading the world’s biggest Muslim-majority nation.

Red-and-white Indonesian flags dotted parts of the city, but celebrations were lukewarm with supporters outnumbered by some 30,000 security personnel deployed amid fears of another attack. Demonstrations were also banned on Sunday as extremist violence continues to plague Indonesia.  “I was worried Islamic (hardliners) would take over the country if he lost,” supporter Suprihatini, who goes by one name, told news agency AFP. “I’m Muslim, but I don’t want that kind of movement here,” the 53-year-old added.

Widely known as Jokowi, the president said his final term would be aimed at eradicating poverty and building the nation of some 260 million into a developed country with one of the world’s top five economies by 2045.

“I’m calling on ministers, public officials and bureaucrats to take these targets seriously,” he told parliament, adding that officials not committed to his goals would be sacked.

Jokowi, a popular, heavy metal-loving former businessman from outside the political and military elite, was hailed as Indonesia’s answer to Barack Obama when he was first elected in 2014, partly on a roads-to-airports infrastructure drive.

Widodo’s leadership has been under rising criticism after a wave of crises that threaten to cast a shadow over his final term. Challenges facing the president range from nationwide anti-government demonstrations, in which three students died, and smog-belching forest fires that sparked diplomatic tensions with Indonesia’s neighbours, to deadly unrest in Papua province and a slowdown in Southeast Asia’s biggest economy.

It marked a stark reversal of fortune just months after Jokowi scored a thumping re-election victory against a former military general. “This is the weakest point in Jokowi’s political leadership,” said Arya Fernandes, a researcher at the Jakarta-based Centre for Strategic and International Studies told AFP.

“It’s a test for the president in critical times.” Protests erupted last month across the archipelago that were among the biggest student rallies since mass demonstrations toppled the Suharto dictatorship in 1998.

Jokowi’s inauguration comes a little over a week after the country’s chief security minister was stabbed in an attack by two members of a local extremist outfit allied to the Islamic State group.

Two suspects were arrested at the scene, while dozens of suspected terrorists have since been detained in a country-wide dragnet following the assassination attempt on Wiranto, a former general who goes by one name. The 72-year-old is recovering in hospital.

Jokowi’s new term also comes amid criticism that Indonesia’s two decades of democratic reforms are being eroded under the watch of a man once lauded by Time magazine as “A New Hope.” Choosing conservative cleric Amin as vice president has also thrown Indonesia’s reputation for tolerant Islam into question. Jokowi’s administration also came under fire in September’s protests that saw thousands of students hit the streets to demonstrate against a raft of divisive reforms, including banning pre-marital sex and changes that critics said would weaken the anti-graft agency.

After decades of dictatorship under President Suharto, Indonesia suffered a violent upheaval by political, ethnic and religious unrest in the late 1990s and early 2000s. Since then, it has consolidated its democratic transition. While most of the country remains poor and inequality is rising, it is home to a rapidly expanding middle class.

(With inputs from AFP)