His prime minister, Camille Vital, appeared on national television to denounce the officers as mutineers.
Vital called on soldiers to "respect discipline, respect institutions and show professionalism," and said soldiers who supported Rajoelina had been sent to dismantle road blocks around the base where Andrianasoavina had made his declaration. Vital also said witnesses in the area say civilians were destroying materials at polling stations.
Col. Charles Andrianasoavina, who last year backed Rajoelina's move to take power, told reporters the military will pursue national reconciliation, is dissolving government institutions and putting in place a national committee to lead the country at least provisionally. He said political prisoners would be freed and called on exiles to return "to work together to save our fatherland." He did not say who would form the provisional governing committee.
The military has repeatedly intervened in politics on the island, undermining democracy.
"The people should remain calm and help preserve the peace," Andrianasoavina said at a military base near the capital's airport.
In making the announcement, the colonel was joined by a general who had served as Rajoelina's military chief and by the former head of security, also a soldier, of Marc Ravalomanana, the president who was ousted in 2009. It was a striking demonstration of unity, given signs in the past that the military has been divided by Rajoelina's rise.
Rajoelina won't be able to hold onto power long without the military's support. Since this Indian Ocean island gained independence from France in 1960 it has struggled to establish stability and democracy.
Despite the officers' declaration, which was broadcast only in part on one independent TV station, voting continued on the island of 20 million. It appeared few were initially aware of the officers' move.
The military was growing increasingly impatient with Rajoelina, who has been internationally isolated and accused of trampling on democracy. The West has frozen all but emergency and humanitarian aid for the impoverished island.
In his statement, Andrianasoavina said Madagascar's people have been awaiting a resolution of the political crisis for months.
Rajoelina has refused to allow Ravalomanana to return from exile in South Africa. In August, a court Rajoelina established convicted Ravalomanana in absentia of conspiracy to commit murder and sentenced him to life in prison in a case related to the turmoil of the coup that toppled him.
Madagascar's southern African neighbors, including regional heavy weight South Africa, have led mediation efforts that have so far failed. The main southern African political grouping appointed former Mozambican President Joaquim Chissano mediator.
"Alas! The different parties continue to hold onto their respective positions, and the people of Madagascar are suffering the consequences of false pride," Andrianasoavina said.
The proposed constitution largely resembles the existing one but a key new clause states that the current leader of a so-called High Transitional Authority — Rajoelina — would remain in power until a new president is elected. That was seen as a bid by Rajoelina to stay in power indefinitely because there was no certainty new elections would be held.
Supporters of Ravalomanana and two other former presidents — Didier Ratsiraka and Albert Zafy — had called for a boycott of the referendum.
Ravalomanana ran a multimillion dollar food and broadcasting empire and Rajoelina himself owns radio and TV stations and is from the wealthy elite that has long dominated politics here.
Most Malagasy, as citizens of the island are called, live in poverty, which ecotourism, vanilla production and the recent discovery of oil have done little to alleviate. The island is famed for its lemurs and other unique wildlife and was the inspiration for two animated films of the same name.