Just after defeating the Phoenicians and destructing the city of Carthage in nowadays Tunisia during the Punic Wars, the Roman armies took possession of Mauretania and divided it into two provinces.
Though Morocco was not part of the Ottoman empire, Moroccan pirates held their activities in both the Mediterranean Sea and the Atlantic Ocean.
In 1783 the United States made peace with and was recognized by Great Britain, and in 1784 the first American ship was captured by pirates from Morocco.
[7] The First Franco-Moroccan War consisted of a series of conflicts fought between France and its colonial administrators on one side, and the sultanate of Morocco on the other.
On March 30, 1912, Sultan AbdelHafid signed the Treaty of Fez, formally ceding Moroccan sovereignty to France, which established a protectorate.
During World War II more than 300,000 Moroccan troops (including goumier auxiliaries) served with the Free French forces in North Africa, Italy, France and Austria.
The two world conflicts saw Moroccan units earning the nickname of "Todesschwalben" (death swallows) by German soldiers as they showed particular toughness on the battlefield .
Skirmishes along the border eventually escalated into a full-blown confrontation after Algerian troops attacked and killed 10 Moroccans soldiers in a town near Figuig.
The Algerian army, just formed from the guerrilla ranks of the FLN's Armé de Libération Nationale (ALN) was still geared towards asymmetric warfare, and had little high-powered equipment .
[9] They were still battle-ready and held tens of thousands of experienced veterans, and strengthening the armed forces had been a top priority for the military-dominated post-war government.
Like many other Arab States, Morocco contributed by deploying 5,500 troops, 30 tanks and 52 combat aircraft to take part in the Yom Kippur War.