Indonesia's President Joko Widodo will kick off a fresh term on Sunday, facing a wave of crises and with Jakarta under heavy security days after militants tried to assassinate his top security minister.
More than 30,000 security personnel were deployed in the capital amid fears of another attack during the inauguration of Widodo, 58, and Vice President Ma'ruf Amin, 76.
The ceremony, attended by foreign delegations and heads of state, is scheduled to start around 0730 GMT.
A crowd of several hundred supporters formed near the presidential palace on Sunday. But celebrations will likely be muted after mass demonstrations were banned as militancy continues to plague the world's biggest Muslim-majority nation.
Widodo, widely known as Jokowi, met several visiting leaders including Singapore's Lee Hsien Loong and Australian Prime Minister Scott Morrison before the swearing-in.
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 to lead the world's third-biggest democracy.
But his leadership is under mounting criticism after a string of challenges in recent months. These 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.
“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.
“It's a test for the president in critical times.”
Recent protests across the archipelago of 260 million were among the biggest student rallies since mass demonstrations toppled the Suharto dictatorship in 1998.
The headwinds threaten to cast a shadow over Jokowi's second and final term — a stark reversal of fortune just months after he scored a thumping re-election victory against a former military general.
'Listens to the people'
The Indonesian leader's April re-election was partly driven by a roads-to-airports infrastructure drive.
Jokowi has said he will press on with reforms including cutting red tape, tackling rigid labour rules and luring more foreign investment. But he'll be grappling with an economy feeling the sting of the US-China trade war and tepid global growth.
Sunday's inauguration comes a little over a week after his chief security minister was stabbed in an attack by two members of a local extremist outfit allied to the militant Islamic State (IS) group.
The two suspects were arrested at the scene, while dozens of suspected militants 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 really listens to the people,” Wiranto told reporters on Saturday in his first public appearance since the attack.
“A good government is one that is responsive to the aspirations of its people.”
Jokowi's new term, however, comes against the backdrop of fears 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 his vice president has also thrown Indonesia's reputation for tolerant Islam into question.
Jokowi's administration appeared caught off guard when thousands of students hit the streets in protests last month against a raft of divisive reforms, including banning pre-marital sex and changes that critics said would weaken the anti-graft agency.
The criminal-code reforms were delayed after the backlash, while a bill that limits the power of Indonesia's corruption buster, known as the KPK, has come into effect.