Nearly two decades after the fall of dictator Suharto forced Indonesia's military out of politics, the army is inching back into civilian roles, risking a setback for democracy in this Southeast Asian nation and perhaps even for the turbulent region.

The vast Indonesian archipelago is one of the world's most-populous democracies and also among the youngest. Many Indonesians welcomed the army's retreat from politics after Suharto's often brutal 32-year rule was ended by mass protests in 1998. But years later, analysts and former generals say the military's national defense role is still not fully accepted among officers or the rank-and-file.

Now, the army is creeping into areas beyond defense as inexperienced President Joko "Jokowi" Widodo relies on it to strengthen his hand against the powerful and unruly police and political parties allied to former President Megawati Sukarnoputri.

Megawati, the daughter of Indonesia's first president, Sukarno, positioned herself as the power behind Jokowi's presidency by letting her party back him during last year's election.

The army has signed agreements with government ministries and state companies that involve it in areas such as providing security for airports, bus stations and railways and helping farmers increase their crops. Some officials have called for army involvement in Indonesia's anticorruption agency to counter attempts by police and their political allies to neuter an institution that is effective and feared.

Jokowi recently nominated an army general to head all military forces, breaking with the schedule of a reform-minded convention of rotating the post between the navy, air force and army.

"I think it is obvious that the move is calculated to bring the army on side given that the president is having so much trouble from friends and foes alike," said Vedi Hadiz, an Indonesia expert at Murdoch University in Perth, Australia. "It is only the army that can scare the police."

Indonesia is by far the most populous nation and biggest economy in Southeast Asia. The resilience of its democracy has extra significance at a time when China's authoritarian leaders are testing U.S. primacy in the region and American relations with Thailand, a key regional ally, have chilled.

The region of some 600 million people is accustomed to rule by autocrats and Indonesia is not alone in struggling to nurture faith in the messy processes of democracy while also meeting expectations for improved living standards.

Last year, generals overthrew civilian rule in perennially unstable Thailand and have no firm timetable for elections. The military remains deeply embedded in Myanmar's nascent democracy, while Malaysia's opposition alliance has collapsed, dimming chances of a change in government after decades of rule by one party.

The risk of greater army involvement is that it "might cause failure in the progress of the transition to democracy for Indonesia," said Agus Widjojo, a retired Indonesian army general who helped lead reforms of the military. "If this is a relapse and a counter-reaction, especially if it starts from the military, it can cause a ripple effect."

Widjojo sees weaknesses on both sides: Jokowi, who lacks confidence without the army at his side, and in the military where many still "cling to the extensive role" of the past.

Jokowi, who is military supreme commander, caused a stir earlier this month when he was photographed at the presidential palace wearing army fatigues rather than a neutral military uniform that would show him as an impartial leader of the armed forces' three branches. He says his nomination of army Gen. Gatot Nurmantyo as military commander was based on the "latest geopolitical and geostrategic situation."

Despite a reputation for brutality, the image of Indonesia's armed forces, known as the TNI, has improved since Suharto's departure, when it relinquished control of internal security, though gray areas remained.

According to the Institute for Policy Analysis of Conflict in Jakarta, the military benefits from favorable comparisons with the poor image of the police, which has worsened this year as it attacked the anti-graft agency. That has allowed the army to portray itself as honest, civic minded and loyal to the president. Separated from the military after the Suharto era, the police grew into a powerful institution and also one of the most loathed as low wages encouraged corruption and lack of professionalism worsened communal conflicts.

The army is "definitely moving into civilian spheres no question," said Sidney Jones, the institute's director. But the institute does not believe the TNI is intent on returning to the center of the political stage. Instead it aims to claim internal security roles such as counter-terrorism from the police and secure more opportunities to bring in cash outside of the national budget.

The money-making opportunities extend to the local level where the military and police compete for lucrative alliances with criminal gangs in the drug trade and other illegal activities, said Hadiz. Jokowi's appointment of Nurmantyo to head the military suggests the president's tacit backing of the army in that rivalry, he said.

As the army tests how far it can extend its authority, particularly if it gets involved with anti-corruption policing, it will face opposition from activists and politicians who prospered in a democracy where the military were comparative outsiders, said Hadiz.

"However, these same politicians seem to instinctively reach out to the military when they are in trouble," he said.

___

Associated Press writer Niniek Karmini contributed to this report.

___

Follow Stephen Wright at twitter.com/stephenwrightAP