Madagascan troops have stormed an army barracks occupied by rebel soldiers, ending a three-day mutiny.
Gunshots rang out shortly before reports emerged that the rebels had given themselves up for arrest.
The mutineers had been holed up in the barracks near the airport of the capital, Antananarivo, since announcing a takeover of the island on Thursday.
Some of the rebels were themselves part of a coup that brought President Andry Rajoelina to power in 2009.
Mr Rajoelina has been diplomatically isolated since coming to power in March 2009 and has ignored attempts by regional mediators to broker a consensus with the opposition.
Madagascar has been beset by instability for several years.
Hundreds of troops were seen heading towards the compound on Saturday, before reports emerged of shots being fired.
However, the situation was soon brought under control, with reports that the renegades had surrendered themselves into custody.
"The operation is over. They gave themselves up. It has ended without bloodshed," Alain Ramaroson, head of the country's Senate defence council, told AFP news agency.
He said the whole operation was over within 20 minutes, AFP added.
The rebel officers made their coup claim as Madagascar prepared to vote in a referendum for a new constitution that would allow Mr Rajoelina to extend his term in office.
Faced with the rebellion, the government on Friday told people living near the soldiers' camp that they should leave the area.
Army chief Gen Andre Ndriarijoana later entered the barracks for talks with the dissident officers, although little news emerged of any progress before Saturday's events.
The new constitution put to the Malagasy people in the referendum would allow Mr Rajoelina to stay in power as long as it takes to organise an election.
It would also lower the age limit for presidential candidates from 40 to 35 years, allowing the 36-year-old to stand.
Mr Rajoelina, who has said he will not run for president, organised huge rallies in support of a yes vote.
He is a former DJ and mayor of the capital city and rose to power on wave of popular support.
But some analysts say his failure to end leadership squabbles has eroded some of his popularity.
In the run-up to the referendum there were many demonstrations against it - and all three of the main opposition groups, each led by an ex-president, called for a boycott.