|Tensions have risen since a group of dissident soldiers announced a takeover [Reuters]
An operation by security forces in Madagascar aimed at storming a base housing rebel soldiers has ended.
Dissident soldiers who attempted a coup three days ago have been based at the barracks outside Antananarivo, the capital, and a solider who took part in the operation told Reuters news agency on Saturday that it ended.
"The mutineers gave themselves up," he said.
At least 50 soldiers were seen at the entrance of the barracks where an explosion and gun shots were heard.
Around 20 soldiers, who declared on Wednesday that all government institutions were suspended and a military council was in charge, have been holed up in the camp. They said they were taking over from Andry Rajoelina, the president, who himself grabbed power with military backing last year.
Al Jazeera's Tania Page, reporting near the base, said the gunfire lasted between 10 and 15 minutes.
"The prime minister has said all of the coup leaders has surrendered," she said.
"We do not know if there were any injuries that were sustained during the storming of the building. Local media is also reporting that all the men have been arrested and transported to one of three locations."
The attempted coup came in the midst of a referendum to accept or reject a new constitution that calls for keeping Rajoelina in power indefinitely.
Tensions had risen in the capital ahead of Wednesday's referendum, with sporadic skirmishes between police and opposition supporters after the government banned public meetings.
Rift within army
The ballot has been controversial, with the three main opposition parties, each headed by a former president, boycotting the vote.
The country's military has suffered from rifts since Rajoelina's 2009 coup, when he toppled Marc Ravalomanana, the then leader, and scrapped the old constitution.
That coup, which had backing from large parts of the military, created turmoil on the Indian Ocean island, prized by foreign investors for its oil, nickel, cobalt and uranium deposits.
Africa's youngest leader, Rajoelina rose to power on wave of popular support, galvanising widespread anger over Ravalomanana's increasingly autocratic style of leadership.
But some analysts say Rajoelina's failure to end the leadership squabbles and deliver on populist pledges have eroded his popularity.