Ancient history: In the first millennium BC, Moroccan lands belonged to Carthage. From the 2nd century BC e., after the conquest of Carthage by the Romans, Roman rule began in North Africa. In 429, the territory of modern Morocco (the Roman province of Mauritania Tingitana) was captured by the Vandals, and a hundred years later, by the Byzantines.
Medieval history: In 682, the Arab conquest of North Africa began. The first Arab state on the territory of Morocco was founded in 784 by Imam Idris ibn Abdallah, who fled from Arabia. The Arab state reached its greatest prosperity during the Almoravid and Almohad dynasties in the 11th-11th centuries. Under the Almoravides, Morocco was the center of a vast empire that occupied the territories of modern Algeria, Libya, Tunisia and the vast territories of Spain and Portugal. However, with the fall of the Almohad dynasty, the empire also collapsed. From the beginning of the 10th century, Portuguese and then Spanish expansion began in Morocco, when several port cities were captured by Europeans (the first expedition was carried out by the Portuguese in Ceuta in 1415). However, in the ХY1-XY11 centuries, a new rise of the Moroccan state began to be observed, which reached its height of power under Sultan Ahmad al-Mansur al-Dhahabi, whose reign is called the “golden age” of the country. At this time (1591), Moroccan troops under the leadership of Judar Pasha captured Songhai, a state in Western Sudan, putting the trans-Saharan trade in salt and gold under their control. Also during the heyday of the 16th century, the Moroccan sultans managed to expand the territory of the state as much as possible, recapturing most of the captured cities from the Spaniards and the Portuguese, capturing the western part of Algeria and pushing the border in the south to Guinea. After the death of Ahmad, the most powerful of the sultans (about 1603), the state began to weaken due to constant internal wars, so that Muley Sherif, a descendant of Ali and Fatima, could easily be overthrown in the middle of the 17th century. dynasty of the first sultans and found a new one, still ruling, the Alid dynasty, or Khozeini. The most famous of them is Muley-Islam, who ruled from 1672 to 1727 as the greatest despot. Under his successors, civil strife and strife over the throne became more frequent, leading the country more and more to decline, until the accession to the throne of Muley-Sidi-Mohammed (1757-89), distinguished by gentleness and aspiration to introduce European culture. After his death, a period of internal conflicts and wars began again. Under Sultan Muley Suleiman (1794-1822), a period of relative prosperity began again.
In the 17th-19th centuries, Morocco was considered a pirate state, since in many cities the actual power was in the hands of sea pirates. It is interesting that this did not prevent Morocco from exercising diplomatic functions; in 1777, Morocco was the first state to recognize the independence of the United States.
Morocco in Modern Times: In 1859-1860, Spain occupied part of the land of the Sultanate. At the end of the 19th century, Morocco (ruled from 1894 by Abd-ul-Aziz) became the object of rivalry between Spain, France, England, and in the 20th century. – also in Germany. France’s capture of the entire Sahara and part of the Sudan, which made it the ruler of almost all of West Africa, aroused its desire to dominate those neighboring states that still retained their independence. Anglo-French agreement on April 8, 1904, Morocco was recognized as part of the French sphere of influence; but this agreement aroused a protest on the part of Germany. In 1905, Wilhelm II visited Morocco, then the German resident in Fetz Tattenbach and Chancellor Bülow launched a strong campaign against French influence in Morocco. They demanded that the draft reforms in M., worked out by France, was considered at a conference of representatives of the interested powers, and not carried out by France alone. Delcassé’s sharp refusal to enter into negotiations with Germany on the issue of reforms in Morocco almost brought France to an open break with the German Empire. Rouvier’s intervention and Delcassé’s resignation helped to settle the conflict, and on July 10, 1905, an agreement was signed between France and Germany to convene a conference. This agreement left open a number of questions – about the reorganization of the Moroccan police, the establishment of a bank in Morocco, the provision of Germany with the port of Mogador in the Atlantic Ocean, etc. The question of the reorganization of the police led France and Germany to conflict. Germany insisted that the reorganization of the police be entrusted to all interested powers. France protested strongly against this.
As a result of the Moroccan crises of 1905 and 1911, France acquired most of the territory of Morocco. During World War II, a large number of Moroccans were drafted into the French army. About 8,000 of them died on the fronts.
The modern period of the history of Morocco: After a three-year period of mass uprisings, which in a number of areas of the country turned into an anti-French rebellion, and a political crisis caused by attempts to change the king, France recognized the independence of Morocco in March 1956, and in April Spanish Morocco also received independence, although several cities remained with the Spaniards. In June 2004, Morocco received the status of the main ally of the United States, which is not part of NATO.