ABIDJAN (Reuters) - Protests by disgruntled soldiers in Ivory Coast have exposed the government's failure to reform its mutiny-plagued armed forces and its rapid capitulation sets a dangerous precedent in a country with bright economic prospects.

Ivory Coast - French-speaking West Africa's largest economy - is emerging from a decade of crisis that ended in a brief civil war in 2011. Its rapid revival and vast potential have made it the new darling of frontier investors in Africa.

When thousands of soldiers poured out of barracks and erected barricades in towns across the country this month, it was a stark reminder of the coups, mutinies and rebellions that have crippled the world's top cocoa grower.

President Alassane Ouattara has received credit for overseeing Ivory Coast's economic renaissance, but has struggled to reform an army thrown together from former government loyalists and ex-rebels.

"The army has always been the weak point and it really surprises me they didn't learn the lessons of the past," said Rinaldo Depagne, West Africa project director for International Crisis Group.

The protesters were former members of the New Forces rebels, who three years ago fought alongside U.N. and French troops to install Ouattara in power after incumbent President Laurent Gbagbo refused to accept his victory in 2010 elections.

Thousands were to receive army salaries from 2009 under a peace deal that eventually collapsed, but Gbagbo never paid them. And after Ouattara took over in 2011, authorities brushed off their repeated demands for back pay and benefits until Nov. 18, when the soldiers hit the street.

"Their message was heard. The President of the Republic has understood it," Interior Minister Hamed Bakayoko said on the evening news broadcast just hours later, promising talks and pledging that the protesters would not be punished.

The next day, with the government forced to the negotiating table, it was the low-ranking, angry ex-rebels who were clearly in charge, forcing a delegation of top ministers to capitulate.

WHO'S NEXT?

While government initially estimated the cost of settling the dispute at around 20 billion CFA francs ($38 million), diplomats put the final figure at around $75 million.

Though a drain on public finances, most analysts and observers concede that Ouattara's weak position left him little choice but to pay up. The greater worry, they say, is what might follow, since many other former rebels have their own demands.

"Since the mutiny, the ambiance in the camp has changed," said one soldier involved in the protests. "We've split into groups. Some are with the chiefs, some are with us. We talk among ourselves. We don't mix anymore."

The past two decades have seen the Ivorian military morph into an unruly beast as successive leaders added new layers of recruits in a misguided attempt to ensure loyalty.

President Henri Konan Bedie favored his own Baoule ethnic group but neglected to pay other soldiers, setting the stage for the army coup that forced him from power on Christmas Eve 1999.

Gbagbo, from the southwest, stacked the security forces with fellow westerners after his election in 2000 but nearly fell to a mutiny by marginalized northern soldiers two years later.

That uprising split the country in half for eight years during which the New Forces rebels recruited thousands of new fighters. Following the rebel victory in 2011, these poorly trained troops also joined the army.

However, they still answer to their powerful rebel commanders, known as 'comzones', who now hold top army posts and have their own competing loyalties to Ouattara, Bakayoko or former rebel leader turned parliament speaker Guillaume Soro.

"The problem is that you have many, many chains of command within the army and nobody's really controlling it from the civilian side," Depagne said.

Ouattara has sought to rein in the chaos with a plan to disarm and demobilize some 74,000 ex-combatants by June.

Critics claim the program has recuperated few weapons and ignored thousands of fighters never formally registered by the New Forces but who remain armed. This group, alongside demobilized ex-fighters, made up a significant part of last week's protesters.

But their demands, which ranged from calls for integration in the army to payment of large bonuses for fighting Gbagbo, were not discussed in the talks. These fighters are blamed for a spike in armed highway attacks and violent crime in parts of the commercial capital Abidjan.

"They are the most dangerous element out there because they are armed, they are quasi-organized and they have a command structure through the old comzones," one western diplomat said.

To ensure stability in the short term, Ouattara, who is seeking reelection next year, must live up to the pledges he made to the protesters last week. The long-term damage caused by the brief uprising will be harder to repair.

"Who's going to come out next?" the diplomat said. "They're opening Pandora's Box. Everybody's got a grievance. Everybody's got something they think they're owed."

(Additional reporting by Ange Aboa; Editing by Daniel Flynn)