The Kingdom of Morocco is the most westerly of the North African countries known as the Maghreb - the "Arab West". It has Atlantic and Mediterranean coastlines, a rugged mountain interior and a history of independence not shared by its neighbours.
Its rich culture is a blend of Arab, Berber, European and African influences.
Morocco was a French protectorate from 1912 to 1956, when Sultan Mohammed became king. He was succeeded in 1961 by his son, Hassan II, who ruled for 38 years and played a prominent role in the search for peace in the Middle East.
He also ruthlessly suppressed domestic opposition. A truth commission set up to investigate human rights violations during his reign confirmed nearly 10,000 cases, ranging from death in detention to forced exile.
Hassan's son and successor in 1999, Mohammed VI, is a cautious moderniser who has introduced some economic and social liberalisation. In 2011 he revised the constitution in response to "Arab Spring" protests, and appointed a new government in January 2012. Powerful trade unions waited until May to launch mass protests against the authorities' failure to meet democratic and economic expectations.
The status of Western Sahara remains unresolved. Morocco annexed the territory in 1975 and a guerrilla war with Algerian-backed pro-independence forces ended in 1991. UN efforts have failed to break the political deadlock.
To the north, a dispute with Spain in 2002 over the tiny island of Perejil revived the issue of the sovereignty of Melilla and Ceuta. These small enclaves on the Mediterranean coast are surrounded by Morocco and have been administered by Spain for centuries.
Morocco has been given the status of non-Nato ally by Washington, which has praised its support for the US-led war on terror. After deadly suicide bombings in Casablanca in 2003, Morocco launched a crackdown on suspected Islamic militants.