Antananarivo, Madagascar (CNN) -- Renegade military officers who declared a coup in Madagascar earlier this week surrendered Saturday following 15 hours of negotiations with authorities, ending the three-day standoff.
The talks were led by Madagascar's Chief of Staff Gen. Ndriarijaona Andre and Gen. Noel Rkotonanadrasana, who represented the renegade soldiers holed up since Wednesday in a military compound near Ivato International Airport.
Witnesses said there were some exchanges of gunfire during the negotiations, but a government soldier stationed outside the compound called it a "misunderstanding," saying the rebels were not aware of the ongoing talks.
A total of 30 rebel soldiers ultimately surrendered. There were no reports of casualties, the military said.
Six of the renegade officers have been arrested and taken to Tsiafahy prison, outside the capital city Antananarivo, government officials said. The remaining 24 were taken to an unknown destination, the officials said.
"The case is now in the hands of justice, which will act in full independence," Prime Minister Gen. Albert Camille Vital said at a news conference Saturday night.
The coup attempt occurred as the country voted on a referendum on a new constitution that would allow current President Andry Rajoelina to extend his term in office.
The officers were demanding an end to Rajoelina's interim government. They want a committee of officers to rule the nation.
Rajoelina ascended to the presidency in 2009 as part of a power-sharing deal, ending months of political wrangling that rocked the island nation off the east coast of Africa. Under the deal, he was to serve with two new co-presidents.
Rajoelina, 35, a former disc jockey, ousted President Marc Ravalomanana with the help of the military in March 2009. The United States condemned the toppling as a coup. U.S. officials deemed it "unconstitutional and undemocratic."
CNN's Umaro Djau contributed to this report.