The French example was followed by Spain, which in 1958 also ceded the northern part of the Spanish Sahara to Morocco and in 1969 Ifni. The sultan assumed the title of king as early as 1957. The social tensions, which already during the reign of Muḥammad had led to the secession from the Istiqlāl party (which had made the greatest contribution to independence) of the most renewing movement led by Ben Barka al-Mahdī, became more serious after the death of the sovereign (1961). In fact, his son Hassan II succeeded him to the throne which, despite the promises contained in the Constitution promulgated in December of the same year, manifested authoritarian tendencies that resulted in the assumption of full powers (1965). If the constitutional reforms of 1970 and 1972 failed to satisfy the expectations of the opposition, a climate of relative national harmony seemed to emerge with the massive mobilization promoted by the sovereign to annex, in agreement with Mauritania, the territory of Western Sahara in under the Madrid agreements (November 1975). However, the initiative provoked the armed reaction of the local liberation forces of the Polisario Front, supported by Algeria and Libya. The political elections of June 1977 saw the affirmation of the pro-monarchist alignment, but the prolongation of the state of war cracked the internal truce, exacerbating the discontent with the government’s economic policy. The crisis, marked by a long series of social unrest, culminated in the bloody riots of Casablanca (June 1981). According to remzfamily, the result was an accentuated repressive action by the government, which only in 1982 began to show some signs of gradual easing. Continuing the support of the neighboring states to the RASD (Saharan Arab Democratic Republic, proclaimed in exile by the Polisario Front in 1976), Morocco therefore tried to mitigate the opposition to the annexation achieved by stipulating a treaty of union with Libya in 1984.
However, the moderate position taken on the Israeli question (with direct contacts between the two countries) soon put an end to this experience (1986), while the continuous diplomatic commitment produced a gradual rapprochement with the other countries of the region. The resumption of relations with Algeria (in 1988, after thirteen years of interruption) thus anticipated the acceptance of a peace plan by UN for Western Sahara. After the January 1989 meeting between Hassan II and a Saharan delegation, however, progress stalled in parallel with the exclusion of the Polisario Front from the institution summit of the Arab Maghreb Union (February) and, only in June 1991, Hassan II, diplomatically isolated, he had to accept a UN peace plan that established the ceasefire from 6 September 1991, also providing for the holding of a referendum for the self-determination of Western Sahara, which continues to be postponed. On 4 September 1992, a new Constitution was approved by referendum which introduced cautious reforms, leaving the sovereign’s broad powers substantially unchanged. In domestic politics, the prolongation of the economic crisis, even as a consequence of the austerity measures adopted, it still kept social tensions alive; increasing attention was also paid to the issue of respect for human rights. In the nineties the good neighborhood policy and the increasing projection of the sovereign Hassan II towards Western countries was aimed at attenuating the international pressure for the solution of the Western Sahara question. The cautious process of modernization of the state, begun in 1992, continued in the decade with acts of clemency towards political prisoners (July 1994), with the recognition of the teaching of the Berber language in primary school (August 1994) and, above all, with the establishment of a bicameral Parliament (September 1996). Better international relations enabled Hassan II to dilute the effects of the 1991 UN peace plan to hold a referendum on the fate of Western Sahara. In reality, Morocco was not very interested in favoring the organization of the referendum, in the awareness of an almost obvious victory for the separatists of the Polisario Front. The only possibility of subverting a negative result was entrusted to the definition of a more elastic criterion to identify the subjects entitled to vote and, in this direction, Hassan II found unexpected help in the then UN secretary Pérez de Cuéllar who, at the end of his mandate, decided to cancel the previous principles of identification by including those who had lived in the Sahrawi territory for at least six years. This was a principle clearly favorable to Hassan II, since he would have admitted to the vote the many thousands of Moroccans who had come to Western Sahara with the “green marches” he organized in previous years.
The opposition of the Polisario Front to the introduction of this rule had the effect of paralyzing the activity of the mission created by the UN (MINURSO) which, having ascertained the impossibility of proceeding towards the referendum, decided to suspend the activity of its mission, also reducing part of the military personnel (May 1996). On the death of Hassan II in July 1999, Sîdi Muḥammad. The latter, having received a heavy social inheritance, in addition to the absolute crisis of Western Sahara, initiated a cautious policy of breaking with the repressive past: freeing political prisoners, fighting unemployment, guaranteeing greater rights for women. In July 2002 Moroccan troops occupied the uninhabited islet of Perejil nominally placed under Spanish sovereignty: a serious crisis with Spain ensued which, after the mediation of the EU, ended with the withdrawal of the Moroccan military and the restoration of the status quo.. In 2003 Morocco was hit by serious terrorist attacks carried out by Islamic fundamentalists. In the wake of the policy of granting greater rights to the population pursued by the new sovereign, in January 2004 the Parliament approved the new family code, proposed by the king, which enshrines the equality of men and women before the law. Legislative elections took place in September 2007, characterized however by a very strong abstention from voting. The wave of protests that touched all the Maghreb countries also involved Morocco, where numerous demonstrations were held in the spring of 2011 (Arab Spring). King Muḥammad VI prepared a constitutional reform to increase the powers of the Prime Minister (by reducing his own), chosen by the king from within the majority party. With a referendum, the reform was approved with over 98% of the voters. However, the reform movement considered the measures taken to be wholly insufficient to give the country a real democratic change. In November 2011, the moderate Islamic Justice and Development party (PJD), which had been in opposition for thirty years, won the legislative elections and obtained 107 out of 395 seats. The task of forming the government was entrusted to A. Benkirane, who constituted a parliamentary coalition in order to initiate the social and economic reforms necessary for the development of the country. The 2016 administrative elections saw a new victory for Justice and Development, which obtained 125 seats of 395 (18 more than in 2011). However, Benkirane failed in the task of forming a new executive and in March 2017 King Muhammad IV deprived him of the office of premier by assigning S. El Othmani the task of forming the new government. In 2017, following the request made by the Moroccan government, the country was readmitted to the African Union (AU), from which it left in 1984 in protest at the decision of the Union (then UOA) to recognize the Democratic Republic of Sarahwi, which Morocco instead considered part of its territory.