Historically, Indonesia has always favoured the Republican Party. That’s mostly because of its trade policies, but Indonesians also remember it was President George W. Bush who finally ended the 15-year military embargo imposed on their country for the bloodshed in East Timor.

President Barack Obama changed all that because of his childhood connections to Indonesia – and Donald Trump has only strengthened those sentiments with his anti-Muslim rhetoric, which left Hillary Clinton the clear favourite among 90 per cent of Indonesians surveyed in an SCMP poll this month.

Little wonder then that her apparent defeat has been greeted with undisguised gloom in Jakarta and among the 8,500 Indonesian students in the US, the majority of whom attend universities in such Democrat bastions as California and Massachusetts.

WATCH: Donald Trump wins White House

Vice-President Jusuf Kalla said before the election result was in that a Donald Trump victory would be “difficult” for Indonesia, and Finance Minister Sri Mulyani Indrawati indicated she was already working on policy contingencies.

‘Everyone is shell shocked’: Singaporeans on Trump’s win

“It’s stunning,” said National Mandate Party legislator Bara Hasibuan, “but it won’t affect Indonesia that much because of his business interests here. What worries me is the global repercussions and what this does to the word economic order.”

Sandra Hamid, Jakarta director of the Asia Foundation, said Trump’s campaign language had set the tone for what much of the “non-White world” – and not just Muslims – found “troubling and horrifying”.

For Hamid, the truly depressing aspect of the election was the way Trump appeared to have triumphed, which she says revealed “something deeper and gloomier” about how many Americans viewed anyone who was not American.

Will Trump win push Malaysia into China’s embrace?

Like most people around the world, Indonesians were astonished at the conduct of the election campaign. While Trump is unlikely to complain about vote rigging now, the whole unseemly circus set a bad example for Indonesia, where democracy is still a work in progress.

US diplomats maintained a non-partisan profile and there was no embassy effort to take soundings among Indonesians over who they preferred, but they did get a steady stream of questions from journalists, politicians and business leaders over the Muslim issue and what it might mean for future relations.

That may now be a very real concern.