As the ranks of protesters thickened in central Jakarta on Dec. 2, turning into Indonesia's biggest mass demonstration since the end of authoritarian rule in 1998, President Joko "Jokowi" Widodo grappled with a dilemma: should he join the rally or stay away?

Recounting what happened behind the scenes that day, two senior officials said Widodo chose to ignore warnings from security chiefs and went into the crowd, appearing alongside the firebrand leader of a hard-line Islamic group.

His move was widely applauded for cooling tensions that had been building for weeks over remarks by Jakarta's ethnic-Chinese Christian governor that were deemed to be insulting to the Koran.