Morocco’s Islamist Justice and Development Party (PJD) has suffered a crushing defeat in parliamentary elections, slumping from first to eighth place.

The liberal National Rally of Independents (RNI) party gained most seats, followed by another liberal party – the Authenticity and Modernity Party (PAM) – which is seen as close to the monarchy.

The RNI and PAM parties took 97 and 82 seats respectively of the 395-seat parliament, while the centre-right Istiqlal Party got 78 seats, according to the preliminary results announced on Thursday.

The PJD only got 12 seats from the 125 seats it had in the outgoing assembly.

Elected politicians in Morocco have only limited powers, as key decisions remain in the hands of King Mohammed VI.