Morocco's moderate Islamists have won parliamentary elections, beating a rival party critics say is too close to the royal palace in a tight race that will complicate negotiations to form a coalition government.
The government has only limited powers, but Friday's ballot for the House of Representatives was a test for the constitutional monarchy five years after Mohammed VI devolved some authority to ease protests for democratic change.
After five years in government, the Justice and Development Party (PJD) won 125 seats while the Authenticity and Modernity Party (PAM) party took 102, according to final results announced by the interior minister on Saturday.
The conservative Istiqlal party took 46 seats.
Under Morocco's system no party can win an outright majority in the 395-seat parliament and the winner must form a coalition government.
The king, who retains most executive power, chooses a premier from the winning party, but building a coalition promises to be tough for the PJD.
With its main rival PAM scoring high and ruling out an alliance, the Islamists potentially need to partner with at least three other parties to secure a majority.