In 788, about a century after the Arab conquest of North Africa, successive Moorish 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. Morocco's strategic location has shaped its history. Beginning with the Phoenicians, many foreigners were drawn to this area. Romans, Visigoths, Vandals and Byzantine Greeks ruled successively. Arab forces began occupying Morocco in the seventh century A.D., bringing their civilization and Islam. The Alaouite dynasty, which has ruled Morocco since 1649, claims descent from the Prophet Muhammad.
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.
Morocco virtually 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. Improvements in human rights have occurred and there is a largely free press. Despite the continuing reforms, ultimate authority remains in the hands of the monarch.
Morocco was the first country to seek diplomatic relations with the Government of the United States in 1777, and remains one of America's oldest and closest allies in the region. Formal U.S. Relations with Morocco date from 1787, when the two nations negotiated a Treaty of Peace and Friendship. Renegotiated in 1836, the treaty is still in force, constituting the longest unbroken treaty relationship in U.S. history. As testament to the special nature of the U.S.-Moroccan relationship, Tangier is home to the oldest U.S. diplomatic property in the world, and the only building on foreign soil that is listed in the U.S. National Register of Historic Places, the American Legation in Tangier (now a museum