Morocco's new Prime Minister Saad Eddine el-Othmani has succeeded in building a governing coalition, ending a five-month political deadlock after only eight days in office.

El-Othmani, 61, of the Islamist Party for Justice and Development, or PJD, announced in a press conference in Rabat on Saturday that an "agreement has been reached" with six political parties to form a coalition government.

"We will proceed step by step," Othmani told AP news agency after the announcement.

"Now that we have defined the members of the government coalition, three steps remain: defining the flowchart and structure of government, then the ministerial portfolios, and then the ministerial departments that each party in the coalition will manage."

The coalition includes pro-market, conservative and socialist parties.

The Islamist PJD won parliamentary elections in October but did not win enough seats to govern alone. Under Morocco's election law no party can win an outright majority in parliament, making coalition governments a necessity.

Abdelilah Benkirane - Othmani's predecessor - failed to build a coalition and alienated potential partners. The protracted crisis was hurting the economy and Morocco's image, and the king fired Benkirane this month in an unusual intervention.

El-Othmani was appointed prime minister on March 17.

READ MORE: Morocco's February 20 movement: 'Demands still alive'

The new six-party coalition includes the PJD, pro-market parties RNI and UC, conservative MP party and the socialist parties USFP and PPS. Together they hold 240 seats in the 395-seat House of Representatives, the lower house of parliament.

The cabinet's ministers are chosen by the prime minister, after consultation with other parties forming the government coalition, then appointed by the king.