In 788, about a century after the Arab conquest of North Africa, a series of Moroccan Muslim dynasties began to rule in Morocco. In the 16th century, the Sa'adi monarchy, particularly under Ahmad AL-MANSUR (1578-1603), repelled foreign invaders and inaugurated a golden age. The Alaouite dynasty, to which the current Moroccan royal family belongs, dates from the 17th century. In 1860, Spain occupied northern Morocco and ushered in a half century of trade rivalry among European powers that saw Morocco's sovereignty steadily erode; in 1912, the French imposed a protectorate over the country. A protracted independence struggle with France ended successfully in 1956. The internationalized city of Tangier and most Spanish possessions were turned over to the new country that same year. Sultan MOHAMMED V, the current monarch's grandfather, organized the new state as a constitutional monarchy and in 1957 assumed the title of king. Morocco annexed Western Sahara during the late 1970s, but final resolution on the status of the territory remains unresolved. Gradual political reforms in the 1990s resulted in the establishment of a bicameral legislature, which first met in 1997. Under King MOHAMMED VI - who in 1999 succeeded his father to the throne - human rights have improved. Morocco enjoys a moderately free press, but the government has taken action against journalists who they perceive to be challenging the monarchy, Islam, and the status of Western Sahara. Influenced by protests elsewhere in the Middle East and North Africa, in February 2011 thousands of Moroccans began weekly rallies in multiple cities across the country to demand greater democracy and a crackdown on government corruption. Police response to most of the protests was subdued compared to the violence elsewhere in the region. A commission set up in March 2011 presented a draft constitution that was passed by popular referendum in July 2011. Under the new constitution, some new powers were extended to parliament and the prime minister, but ultimate authority remained in the hands of the monarch. That same month, the king urged swift implementation of the new constitution, starting with the holding of parliamentary elections in 2011 instead of in 2012. A prominent moderate Islamist party, the Justice and Development Party, subsequently won the largest number of seats on 25 November 2011, becoming the first Islamist party to lead the Moroccan Government. In January 2012, Morocco assumed a nonpermanent seat on the UN Security Council for the 2012-13 term. - The World Factbook