US President Barack Obama. Pic: AP.

WASHINGTON (AP) — U.S. President Barack Obama on Wednesday congratulated Indonesia’s presidential election victor Joko Widodo, even as the losing candidate rejected the result.

That underscored Washington’s intent to deepen ties with Jakarta and support democracy in Southeast Asia.

A peaceful transfer of power in Indonesia would buck a worrying trend in the region marred by flawed elections and military meddling. It would also serve to show that democracy thrives in the country with the world’s largest Muslim population.

(ANALYSIS: Prabowo’s petulance mars Jokowi’s Indonesia election win)

Over the past year, there have been disputed elections in Malaysia and Cambodia. Thailand, once an example of democratic progress, is facing its most repressive period of military rule in decades.

Political change has been comparatively smooth in Indonesia since the end of the 30-year rule of former dictator Suharto in 1998.