IN 2014, then presidential hopeful and outsider Joko Widodo attended packed campaigns with a white ribbon warning against election fraud tied around his head.
At the time Jokowi — as the president is known — symbolised democracy, change and the hope of a better, cleaner Indonesia.
After two terms and a decade in power, he has left an indelible mark on the nation of 280 million, presiding over a period of strong economic growth and massive development.
But critics say his rule also has been marked by a rise in old-time patronage and dynastic politics, and the diminished integrity of courts and other institutions.
Analysts say the trend may continue under president-elect Prabowo Subianto, a member of the elite that ruled Indonesia before Jokowi and an ex-special forces commander who was dismissed from the military amid speculation of human rights abuses, assertions he has denied.
In this year's presidential election, Jokowi turned his back on his party candidate and helped secure a win for Prabowo, who had chosen Jokowi's son as his vice-president.
"Jokowi has done a lot of damage to democratisation in recent years" said political analyst Kevin O'Rourke.
"It's hard to see how the recovery can come about."
For a man once celebrated for his lack of ties to Indonesia's powerful military and civilian oligarchs, Jokowi leaves office facing accusations he has tried to change laws to benefit his family and co-opt state bodies to control his opponents.
Once a furniture manufacturer in the city of Surakarta, Jokowi rose from mayor to Jakarta governor before he was elected president in 2014, defeating Prabowo. He beat Prabowo again in 2019, but then made the former general his defence minister.
When Jokowi steps down on Oct 20, his legacy will include leaving Indonesia in the hands of Prabowo, the former son-in-law of authoritarian ruler Suharto and the son of a former minister.
Prabowo has, in the past, advocated returning to an earlier version of the Constitution where the president is not directly elected by the people.
Indonesia adopted term limits after Suharto's three-decade rule, marred by corruption and nepotism, ended in 1998 amid the economic and political chaos triggered by the Asian financial crisis.
In March, Prabowo described democracy as tiring, costly and messy, but he has not recently referred to reviving the old Constitution.
"Jokowi's first period was when he really delivered what he promised," said his former deputy chief of staff, Yanuar Nugroho, including an improved national health insurance scheme, which now covers more than 90 per cent of the population, and mammoth infrastructure development.
During the Jokowi years, Indonesia posted solid economic growth and low inflation and attracted foreign investors to develop its mineral processing industry, notably in nickel, a key component in electric vehicle batteries.
A distinct shift came in Jokowi's second term, when he consolidated power and his aides began talking about a possible constitutional change to allow him a third term, and when that went nowhere, a term extension, according to media reports.
Critics say the president's supporters had threatened corruption charges to keep opponents in line. The sudden resignation of Golkar party chief Airlangga Hartarto in August and his replacement by a Jokowi loyalist was among the cases where legal threats were deployed for political gain, media reports said.
"What we've seen is the president growing confident because he's learned that he can actually get away with it," said Sana Jaffrey, a research fellow at the Australian National University.
The integrity of the judiciary came into sharp focus last October when the constitutional court — at the time headed by Jokowi's brother-in-law — issued a ruling that allowed the president's elder son, 37-year-old Gibran Rakabuming Raka, to run for vice-president by changing age requirements.
Protests erupted this August, after Parliament proposed more election changes that would have allowed Jokowi's younger son, Kaesang, to run in regional elections in November. Lawmakers then abandoned the plan.
"It's as if he erased all the good things that he has done," said Yanuar, who joined the protests.
Reflecting on his decade, Sana said Jokowi had taken Indonesia right to the edge, but not yet into "competitive authoritarianism".
The writers are from Reuters