ANTANANARIVO (Reuters) - Madagascar’s president said on Monday he had appointed local International Labour Organisation representative Christian Ntsay as prime minister.

Olivier Mahafaly resigned the premiership earlier on Monday to comply with a court ruling that ordered the formation of a consensus government to end a political crisis.

In an address to the Indian Ocean island nation, broadcast on radio and television, President Hery Rajaonarimampianina said he had held discussions with “all political movements” before making the appointment.

He praised the new prime minister as an experienced man who “has the qualities and knowledge to lead the country to ... the presidential election”.

Earlier this month, Rajaonarimampianina approved a new election law removing a provision that would have prevented the main opposition candidate, Marc Ravalomanana, from standing for office. The previous law had provoked a political crisis and triggered street demonstrations that resulted in two deaths.

The High Constitutional Court ordered Rajaonarimampianina to dissolve his government and appoint a new prime minister with the support of all political parties.

The next presidential election is due this year.

“The discussions resulted in the establishment of a government open to other political forces to ensure the neutrality of the organisation of the presidential election,” the president said in the broadcast.

Madagascar is one of the world’s poorest countries, despite reserves of nickel, cobalt, gold, uranium and other minerals. A coup in 2009 scared off foreign investors.

Rajaonarimampianina’s party has no lawmakers in parliament and he had until June 5 to pick the consensus prime minister as ordered by the court.