A man casts his ballot inside a polling station in Casablanca, Morocco, Wednesday, Sept. 8, 2021. Moroccans are choosing a new parliament and local leaders in elections reshaped by the pandemic. AP
Moroccans voted Wednesday to eject the moderate Islamist Justice and Development Party (PJD) from its 10-year grip on government.
Here are some milestones in the more than two-decade reign of King Mohammed VI.
1999: Breaks with father
On July 23, 1999, Mohammed ascends the throne at age 35 on the death of his father Hassan II, who kept a tight grip on power for 38 years.
He says wants to "lighten the burden of poverty" afflicting his subjects and promote "a new conception of authority".
He breaks with his father by allowing the return from exile of historic opposition leader Abraham Serfaty.
He also sacks all-powerful interior minister Driss Basri, who symbolised the repression of his father's reign.
Mohammed travels to the traditionally restive Berber Rif region in the north, which his father never visited, and opens the way for an amnesty for political prisoners.
The 2002 parliamentary elections are seen as a key step towards democracy, following rigged votes under the previous regime.
But his declared reforms preserve the monarch's wide powers and firm grip on strategic sectors.
2003: Casablanca attacks
On May 16, 2003, five suicide attacks kill 33 people, mostly Moroccans, and wound scores more in the economic capital of Casablanca.
Parliament adopts an anti-terror law which considerably strengthens judicial and police powers.
Another bomb attack on a Marrakesh cafe in April 28, 2011, leaves 17 dead, including foreign tourists.
In late 2018, an Islamic State-linked group murders two Scandinavian women hikers in the High Atlas mountains.
2011: Protests and reform
The Arab Spring sees tens of thousands of people march for reform in February 2011 with human rights groups also calling for further change.
In a July 1 referendum, Moroccans massively back what Mohammed describes as a "comprehensive constitutional reform".
It devolves many of his powers to the prime minister and parliament, while preserving his political and religious pre-eminence.
On November 25, the PJD sweeps to victory in legislative elections, after decades in opposition.
But after another Islamist win in 2016, a new coalition government fills the most strategic ministerial posts with trusted men from the palace, weakening the political parties.
On Wednesday, the PJD suffers a crushing defeat in parliamentary polls to liberal parties, with its support collapsing from 125 seats to just 12.
2016: Social unrest
The Al-Hirak al-Shaabi ("Popular Movement") emerges in the Rif region amid anger over the death of a fishmonger crushed by a garbage truck as he tried to recover swordfish seized by police.
It sparks protests to demand development in the long-marginalised Berber region, which were also at the heart of the 2011 protests.
Hundreds of people are arrested and sentenced, with Hirak figurehead Nasser Zefzafi given 20 years for "plotting to undermine the security of the state".
Similar unrest rocks the mining town of Jerada in the northeast in 2017-2018.
2017: Rejoins African Union
Morocco rejoins the African Union, which it had left in 1984 in protest at the admission of the Sahrawi Democratic Arab Republic of the disputed Western Sahara that Morocco annexed in 1975.
- 2020: Normalisation with Israel -
Morocco normalises ties with Israel on December 10, 2020 in a diplomatic quid pro quo that sees Donald Trump back Moroccan sovereignty over the Western Sahara.
2021: Algeria stand-off
On August 24, Algeria announces it is severing ties due to Rabat's "hostile actions".
Relations between the neighbours have been tense for decades due to Algeria's support for the Polisario which seeks independence in Western Sahara. Morocco, which controls around 80 percent of the desert territory, has offered autonomy.