Ivory Coast's government and rebel troops have reached a final deal at talks in Bouake, government sources said late Friday at the close of a tense day which saw outbreaks of gunfire at barracks across the country.
Soldiers in Bouake mutinied earlier this month, firing rocket-launchers and terrifying residents of Ivory Coast's second largest city, while demanding bonuses, better pay and housing.
The protests then spread to other cities, including the economic capital Abidjan, stoking security fears in the world's top cocoa producer.
The mutiny saw President Alassane Ouattara order major changes in the top security ranks -- the armed forces' chief of staff, the senior commander of the national gendarmerie and the director-general of the police.
"A deal has been reached in Bouake between the chief of staff, the defense minister and the (rebel) troops," a source close to the presidency told AFP late Friday.
Several rebel soldiers confirmed that a deal had been struck, with one telling AFP: "We are pleased, we've reached an agreement".
"The troops have agreed to return to their barracks, and for this reason gunfire has halted in Bouake," a local official said. He said the mutineers had managed to obtain a bonus of about 7,500 euros ($8,000).
While an initial deal had been reached almost a week ago, talks on implementing the agreement only began Friday and tensions were high with rebel troops taking up positions on the roads into Bouake and firing into the air.
Regular gunfire was heard throughout the day, including at Akouedo, the biggest barracks in the capital Abidjan and at Odienne in the northwest and Bondoukou in the east.
There were fears before the deal was struck that the defense minister could be taken hostage and a general mutiny unleashed. However, he left the talks unharmed.
One source said the soldiers had originally been demanding a raise of 15,000 euros ($16,000) each, a significant amount given that many Ivorians earn about 150 euros ($160) a month.
It remains to be seen how the government will finance its promise of the agreed 7,500 euro bonus.
In more problems for the government, Ivorian state employees were also on strike this week protesting against pension cuts and a plan to raise the retirement age.
Bouake, which is home to 1.5 million people, was the cradle of a rebellion which erupted in 2002 in a failed attempt to oust then-president Laurent Gbagbo.
The revolt sliced the former French colony into the rebel-held north and the government-controlled south and triggered years of unrest.
Twelve years later, a similar dispute over pay by rebels-turned-soldiers erupted in Bouake which spread to Abidjan and briefly brought the country to a standstill.
The government then agreed to a deal that provided amnesty for the mutineers and a financial settlement.
The Ivorian army, which consists of about 22,000 soldiers, includes many former rebels who were integrated into the armed forces after years of conflict.