Security forces have recently clashed with supporters of the ousted president
Soldiers have stormed Madagascar's constitutional court and arrested its head of security, who has been accused of destabilising the country.
Journalists were allowed into the court in the capital, Antananarivo, following the raid and shown a cache of weapons.
Supporters of former President Marc Ravalomanana have been pressing the court to reverse its decision to recognise the leader who ousted him.
Andry Rajoelina came to power in March after weeks of unrest.
The BBC's Jonny Hogg in Madagascar says the raid on the court may be an attempt to intimidate the judiciary.
Several cars filled with heavily armed soldiers - most from the regiment that brought Mr Rajoelina to power - arrived at the court in mid-afternoon and fired warning shots to disperse spectators, our correspondent says.
A few minutes later journalists were allowed into the court grounds and shown weapons that had apparently been hidden there.
The AFP news agency quoted sources as saying that the military operation was aimed at rounding up remnants of the armed forces who remained loyal to Mr Ravalomanana.
Mr Ravalomanana was forced from power in March by the army which backed Mr Rajoelina, following weeks of protests by his supporters.
But in recent days, the streets of Antananarivo have become the scene of daily rallies by backers of the former president.
A week ago, two people died when police clashes with protesters, leading the government to ban public demonstrations.