Madagascar's top court has tossed out parts of new electoral legislation that sparked nearly two weeks of protests against President Hery, the court said.
Several articles -- including revision of electoral rolls, the length of election campaigns and requirements to stand for president -- were ruled to be "against the constitution", according to a post overnight Thursday on the website of the High Constitutional Court.
Since April 21, hundreds of opposition supporters have occupied the May 13 Square in the heart of the capital Antananarivo, demanding the resignation of the president ahead of general elections seven months away.
The opposition argued that the electoral laws were loaded in Rajaonarimampianina's favour and accused the government of trying to elbow them out of the race.
The court ruling came a day after Madagascar's security establishment appealed to the warring political parties to reach an agreement.
"It's enough bloodshed, loss of human life, do not make selfishness and greed reasons to sacrifice our compatriots," said the defence minister, General Beni Xavier Rasolofonirina, reading from a statement signed by military and police chiefs.
At least two people were killed and 16 people wounded on the first day of demonstrations, with the police accused of firing live ammunition into the crowd. Protesters said five people were killed.
The court annulled articles that shortened the second round of campaigning from two weeks to a week and provided an option to use single ballots for each candidate, rather than lists.
Critics had argued that single ballots were more vulnerable to fraud than grouped lists of candidates, quite apart from the cost of preparing separate papers for the poll.
New conditions to stand for election as head of state were also annulled, after the opposition protested that they could bias the selection of potential front-runners.
"It remains difficult to give my considered opinion before a detailed study of the ruling of the High Constitutional Court, but from what I've heard (the court) has all the same put matters to rights," opposition MP Brunelle Razafitsiandraofa told AFP.
"We're heading towards the elections now," said the president of the RVM presidential party, Rivo Rakotovao. "No further examination of clauses is required, there are just reservations."
Elected in 2013, Rajaonarimampianina has not yet announced whether he will stand for re-election in a country that has been politically volatile since the last years in office of former Marxist military ruler Didier Ratsiraka, voted out in 2001.
Two ex-heads of state and onetime mayors of the capital have already said they will stand: Marc Ravalomanana, who was president from 2002 to 2009, and Andry Rajoelina, who removed Ravalomanana after mass public protests and an army mutiny.
Both were barred from running in 2013 and their parties have been involved in the demonstrations, but the two men have since made common cause against the current regime.