An attempted coup on the troubled Indian Ocean island of Madagascar has been defused without bloodshed, the regime's prime minister said.

Camille Vital told reporters that 16 army officers surrendered, ending an impasse which began on Wednesday when a group of soldiers declared that they were taking over from leader Andry Rajoelina.

Mr Rajoelina, a former mayor and disc jockey, himself had the military's support when he toppled an elected president last year after months of violent protest.

Earlier, reporters saw hundreds of troops loyal to Mr Rajoelina converge on a base near the airport in the capital, Antananarivo, where the mutineers were holed up. Officials said talks were planned, but shots could be heard inside the base.

Colonel Julien Ravelomihary, a high-ranking member of the High Transitional Authority's military, told reporters that mutinous officers were ready to hand themselves over, but some junior officers initially resisted.

Despite the sound of shooting, Mr Vital said, "This crisis ended with the surrender of the mutineers, without bloodshed or threat to human life."

He said those who surrendered would face trial.

Earlier, police fired tear gas to break up a crowd of several hundred anti-Rajoelina demonstrators in central Antananarivo.

The protest was led by a mayors' organisation which is seeking a negotiated resolution to the crisis. Police said they arrested the group's leader. No injuries were reported.

The protesting mayors said they also oppose an electoral plan imposed by Mr Rajoelina.