Madagascar's Constitutional Court said on Friday that a new prime minister should be named by June 12 at the latest to lift a political crisis sparked by controversial electoral reforms.
Madagascar has been rocked by violent protests since April 21 that initially sought to oppose new laws the opposition said were crafted to bar their candidates from participating in planned elections this year.
Last Friday, the Constitutional Court ordered President Hery Rajaonarimampianina to form a government of national unity and to "name a consensus prime minister" within seven days.
The composition of the government should proportionately reflect the outcome of the last legislative elections in 2013, the court said.
However, interpreting the ruling has triggered fierce debate between the government and the opposition.
Both sides say they hold the majority in parliament, where many legislators have switched allegiances since 2013.
The Court created further confusion when it also gave the government and opposition 10 days to mediate their differences alongside the seven-day deadline.
The situation prompted Rajaonarimampianina to seek clarification from the Court.
"The prime minister and the current government must leave office... by June 5, 2018 at the latest," said a court ruling issued on Friday.
The president will then have until June 12 to name the new "consensus" prime minister, it added.
Since April 21, hundreds of opposition supporters have occupied the key May 13 square in the heart of the capital Antananarivo.
They initially gathered to call for controversial electoral reforms to be scrapped, but the rallies evolved into demands for the president to step down.
* Sign up to News24's top Africa news in your inbox: SUBSCRIBE TO THE HELLO AFRICA NEWSLETTER
Elected in 2013, Rajaonarimampianina has not yet announced whether he will stand for re-election.
The island nation has been politically volatile since the final years of former Marxist military leader Didier Ratsiraka's rule. He was voted out in 2001.
Neither domestic nor international efforts to resolve the crisis have yet borne fruit.
The most recent effort, a gathering of the National Reconciliation Council that included government and opposition delegates, finished inconclusively on Friday.
Defence Minister general Beni Xavier Rasolofonirina threatened on Thursday to deploy security forces if the government and opposition failed to resolve the crisis.
While elections were expected between November and December, the Consitutional Court has ordered that they should be held in the "Dry Season" - between May and September.