It became independent in 1956 from France. Before that period, the issue of its being in the French sphere of influence annoyed Germany massively, resulting in the Moroccan Crises of 1905 and 1911.
It currently rules the disputed territory of Western Sahara, where a fragile ceasefire holds sway. (PS: Try to avoid showing a Moroccan any map that doesn't show Western Sahara as an integral part of Morocco; they get rather worked up about that.)
There have been a couple of terrorist attacks in Morocco, targeting symbolic buildings and killing mostly Moroccans and a few Spaniards, which justified the Moroccan version of the PATRIOT act and allowed the regime to arrest every and any body they want. This has proven so advantageous to it, that the idea that it was actually orchestrated by them is very widespread. It speaks volumes of the jadedness of Moroccans concerning the Palace that they believe it might be true and they still don't care.
Perhaps the reason for this is the 38-year reign of Hassan II, who ran the world's certifiably worst political prison and whose Secret Police put pretty much every other Middle Eastern leaders to shame (particularly during the Years of Lead). He was nevertheless well-liked by most Moroccans; his son, Mohammed VI, is pretty much loved, being actually kinda interested in reform (although he doesn't go quite far enough for some) and attempted to atone for some of his father's harsher policies.
Despite its French legacy, Morocco might fairly be called the Britain of the Arab world: Morocco doesn't seem to like sudden change. Not for nothing is the current (Alouite) dynasty the longest-lasting (400 years!) royal family of a sovereign state outside of Europe and Japan. This tendency was seen most recently during the Arab Spring, where Morocco did see protests—and much as the bobbies didn't (or rather couldn't, as they weren't given firearms) fire on the British protesters in 1848, the Moroccan police kept well away from the protesters in 2011. As a result, the Moroccan protest movement didn't get enough momentum to become a full-on uprising or revolution, and in July 2011, the Moroccan people approved constitutional reforms that put the system of government within shouting distance of democracy (although the king's powers remain extensive). The subsequent elections gave a plurality to the moderate Islamist Justice and Development Party (PJD,note modeled on the Turkish party of the same name); by the terms of the constitutional amendments, the government was initially headed by Abdelilah Benkirane of the PJD, and is currently led by Saadeddine Othmani of the same party. The King himself recognizes the trend in his country, and has said he does not expect that his son will ever exercise any real power.
It is a member of the Arab League, has strong ties with The European Union and is a major US ally, in spite of its population, being the first nation to recognize the United States. However, it was for a long time also the only country in Africa that not part of the African Union, due to the AU recognising the independence of Western Sahara. There may also be a cultural subtext to this: Moroccans steadfastly refuse to think of themselves as "African" — visit Fes, Marrakesh, or Rabat and ask what continent you're in, and they'll adamantly reply "extremely Southern Europe." However, in 2017, the kingdom joined the AU.
Although associated in many Westerners' minds with "desert," Morocco's real defining geographical characteristic is "mountains." The Atlas Mountains trap humid air from the Atlantic, creating a fairly large area in the northern part of the country dominated by green fields and rolling hills, good for farming and especially for raising livestock (for this reason, meat is rather cheaper in Morocco than it is in many other Arabic-speaking countries: because much of Morocco's farmland is marginal at best for crops but excellent for raising sheep and goats, the Moroccan diet features a good deal more meat than that of its Arab neighbors). It doesn't start to get really arid until around the line between Marrackesh and Essaouira in the south—about where the mountains start to peter out.
Cities in Morocco:
- The capital is Rabat (Arabic: الرباط, Al-Ribāṭ)note a city of broad avenues, nice architecture, and not very much else these days; people live there and have their (often government-related) day jobs there, but there isn't much in the way of shopping or exciting culture. The heart of Rabat is actually its twin city Salé (Arabic: سلا Sala), where many government workers live and which is a bit more interesting. The twin cities do have an interesting history, however; the area was originally settled by Phoenicians, and in the 18th century, Rabat and Salé were famous as a pirate-run republican city-state.
- The largest city and commercial capital is Casablanca (Arabic: الدار البيضاء, al-Dār al-Baiḍā',note although this use is restricted to relatively formal circumstances in Morocco). Casablanca is famous, of course for Casablanca, and indeed it was something of a City of Spies during World War II. Today, it's famous for playing host to a gigantic mosque and having pretty much everything. Most major Moroccan companies are based in Casablanca, and pretty much any trip to the country must go to this city. A foreigner going to Morocco is likely to come through Casablanca's gigantic Mohammed V Airport, and Casa (as locals call it) is more or less the center of the nation's transit network.
- One of the most famous cities in Morocco is Marrakesh (Arabic: مراكش, Marrākush), which has a very well-marketed Old City and a booming tourist industry as a result. Expect any scene in Marrakesh to involve at least one person being accosted by a street performer and his trained monkey.
- Fez (Arabic: فاس, Fās; also written Fès, as that's how it's done in French) is Morocco's cultural and religious capital, featuring not one but two Old Cities, the Al-Karaouine University (an Islamic institution of higher learning founded in 859, making it one of the world's oldest universities), and a great number of mosques and institutions of religious learning besides. And yes, the hats are originally from here, too; the iconic red color comes from the historical practice of dying them with local berries, and fezzes made in Fez tend to be lower and wider than the ones made famous by the Turks.
- Tangier (Arabic: طنجة, Ṭanja(h)) was a Truce Zone for a very long time, making it yet another City of Spies. Being on the southern side of the Strait of Gibraltar, it has a strong Spanish influence (they even call sandwiches bocadillos—try them, they're good). Also has the strongest maritime tradition, thanks to its strategic location; also famous for its seafood (its fish tagines are famous across the country, and if you're going to have a seafood dish in Morocco, Tangier is the place to do it).
- Ifrane (Arabic: إفران/يفرن Ifrān) is in the Atlas Mountains, and was built by the French. It has been called "Morocco's Little Switzerland" due to its architecture, imported European plants, and its cold temperatures with snowy winters; the town is a ski resort. (Fun fact - The coldest temperature in Africa was reported in Ifrane at -24.3 C/-11.7 F.) It also plays host to Al Akhawayn University, a Saudi-funded American-style university that positions itself as a kind of Moroccan Oxford or Harvard.
- Meknes (Arabic: مكناس Maknās; often written "Meknès" because that's how it's done in French) is the fifth-largest city (when you count Rabat and Sale together), and has a bit of history to it, as it was the capital of the country before being moved to Marrakesh and then Rabat. As a result, it has a large number of very old royal buildings. It is also very close to the very attractive ruins of the Roman colony of Volubilis and the pretty—and living—town of Moulay Idriss, the oldest Muslim settlement in Morocco.
- Chef Chaouine (Arabic: شفشاون, Shafshāwin) is famous for the beauty of the Rif Mountains and its pretty buildings decked out in white and blue, but foreigners are more attracted to the ridiculous amount of cannabis grown in the surrounding countryside. This region grows an appreciable fraction of the hashish in Europe.
- Essouera (Arabic: الصويرة, as-Ṣawīra) is notable as the original home of the Moroccan Navy, although foreigners are more attracted to the musical festivals, the surfing (it has some truly fantastic waves for surfing), the fact that Jimi Hendrix liked to vacation there, and the impossibly good and cheap hashish (oh, Europeans...).
- Agadir (Arabic: اگادير, Āgādīr) is primarily notable as Morocco's attempt to recreate Monaco and Dubai all in one. It has a reputation for attracting Eurotrash who can't afford either of those two, but still want to have a debauched time in a place with nice weather. Locals tend not to approve.
- Cinephiles are well-advised to visit Ouarzazate, where numerous films involving desert or big mountains were shot.
- People wanting the "desert" experience, or who think deserts are beautiful, may want to go to Merzouga. The town and various hotels/camps have become a bit of a tourist trap, but the location near Erg Chebbi—a very large Sahara erg (i.e. huge sand dune region) with very pretty reddish sand—makes it worthwhile.
- The middle altitudes of the mountains have some interesting coniferous forests that are absolutely wonderful for hiking and camping. They resemble nothing if not the redwood forests of the American Pacific Northwest—but with monkeys (specifically, Barbary macaques).
- Alias had an episode partly set in Rabat.
- NCIS featured Ziva David as an undercover nightclub singer in Rabat, before a bomb went off. She only suffered minor injuries.
- In Command & Conquer: Red Alert 2: Yuri's Revenge, Premier Romanov's plane is shot down over Morocco and the Premier takes refuge in the city, finding it surprisingly pleasant by the time the Commander reaches him.
- Part of The Bourne Ultimatum takes place in Tangier, Morocco.
- Marlene Dietrich's first American movie was simply called "Morocco".
- Two episodes of the old shoujo anime Hana no Ko Lunlun happen in Morocco, where she helps a Moroccan boy and his grandfather to return to their old village.
- The 1956 version of The Man Who Knew Too Much takes place in Marrakesh, before the action moves on to London.
- John Milius's 1975 film The Wind and the Lion is mostly set in Morocco, drawing loosely on a diplomatic incident in 1904.
- March or Die provides a heavily fictionalized depiction of the Rif War of 1921-1926.
- Dreamfall: The Longest Journey has the main character (Zoë) live in Casablanca.
- Became a playable civilization under Ahmad al-Mansur in Civilization V's Brave New World expansion. They're a good civilization to play if your goal is to get filthy rich.
- William S. Burroughs spent a lot of time in Morocco. This also inspired the Moroccan setting in Naked Lunch.
- Brian Jones (The Rolling Stones) recorded an album full with music by the Moroccan folk group The Master Musicians Of Jajouka: Brian Jones Presents the Pipes of Pan at Jajouka (1971).
- Patton opens in Morocco, with Patton being awarded by the Moroccan monarch in the aftermath of Operation Torch.
The Moroccan flag