Algeria borders seven countries and territories: Morocco, Tunisia, Libya, Niger, Mali, Mauritania and Western Sahara. Added together, the lengths in the individual border surveys come to roughly 6,400 km. Morocco has the longest border at 1,559 km, followed by Mali (1,359 km), Tunisia (1,034 km), Libya (989 km), Niger (951 km) and Mauritania (460 km), with just 41 km facing Western Sahara. Reference tables that measure the lines differently give a total of about 6,734 km. Algeria is the largest country in Africa, at about 2,381,741 km². Most of its frontier was drawn by France between 1845 and 1962, and the longest stretch, with Morocco, has been closed since 1994.
Each of these lines dates from a particular treaty, decree or war, so they are taken here in the order they were drawn.
1845: the Treaty of Lalla Maghnia and the first Moroccan line
France captured Algiers in 1830 and took most of the northern coast from the nominal control of the Ottoman Empire between 1830 and 1847. Morocco stayed independent, and the frontier between the sultan's lands and the old Ottoman regency had never been precisely fixed. The French closed part of the gap with the Treaty of Lalla Maghnia, signed on 18 March 1845. It drew a line from the Mediterranean, just west of today's Marsa Ben M'Hidi, south to Teniet el-Sassi. Protocols signed on 20 July 1901 and 20 April 1902 pushed the line south as far as the oasis of Figuig, without much detail.
South of Figuig nothing was agreed. The desert was thinly settled, administration was vague, and when France and Spain divided Morocco between them under the 1912 Treaty of Fes, the gap did not matter much, because France ruled on both sides of it. It mattered a great deal once Morocco became independent in 1956 and Algeria followed in July 1962.
1888–1923: French decrees on the Tunisian frontier
Tunisia became a French protectorate in 1881, so its border with Algeria began as a line between two French possessions rather than a negotiated frontier. French decrees, notably those of 1888–89 and 1901, set the boundary from the Mediterranean coast south to Bir Ramane. The southern sections down to the Libyan tripoint were delimited between 1911 and 1923. Today the 1,034 km border runs south from the coast near Tabarka, passing Tunisian towns such as Ain Draham, Ghardimaou and Sakiet Sidi Youssef and the Algerian city of Tébessa, and turns into straight desert lines in the south. When Tunisia became independent in 1956, France confirmed the existing line with it in an agreement of 6 January 1960.
The border was heavily fortified during the Algerian War. In September 1957 France brought the Morice Line into operation. It was a 2.5 m electric fence carrying 5,000 volts, flanked by minefields 45 m deep, and it ran 460 km along the Tunisian frontier and 700 km along the Moroccan one. Its purpose was to stop National Liberation Front fighters and supplies coming in from bases across the border. Since independence, relations between Algiers and Tunis have generally been good.
1905 and the Niamey Convention: straight lines across the Sahara
Algeria's southern borders are the clearest example of lines drawn on maps by people far away. After the Berlin Conference of 1884–85, France claimed the upper Niger valley and occupied what are now Mali and Niger around 1900, and Mauritania in 1903–04. Meanwhile French forces pushed south from the Algerian coast and conquered much of the Algerian Sahara in 1902. On 7 June 1905 two French officers fixed the line between French West Africa and French Algeria: the Commandant of Upper Senegal and Niger and the military commander of Algeria's Département des Oasis. The Niamey Convention of June 1909 refined it. That one agreement is the origin of Algeria's borders with Mauritania, Mali and Niger.
- Mauritania (460 km): a single straight line running north-west to south-east between the Western Saharan and Malian tripoints, through one of the emptiest stretches of the Sahara. The two countries proclaimed their first official crossing, linking Tindouf with Zouérat, in 2018.
- Mali (1,359 km): continues the Mauritanian line for about 752 km, then turns south-east just north of the 21st parallel, following the Tin-Zaouatene and I-n-Akantarer wadis before a final straight line to Niger. The main crossing is between Bordj Badji Mokhtar and Tessalit.
- Niger (951 km): three straight lines heading north-east, of 175 km, 229 km and 552 km, entirely within the desert. The only official crossing is on the Trans-Sahara Highway between In Guezzam in Algeria and Assamakka in Niger.
All three became international frontiers when Mauritania, Mali and Niger gained independence in 1960 and Algeria followed in 1962. They cut across the lands of the Tuareg and other Saharan peoples, and the routes along them are much older than the borders. Our account of the trans-Saharan trade routes traces the caravan roads that once ran from the Niger bend to the Algerian oases.
1900–1957: Spain, France and the 41 km Western Sahara line
The shortest border comes from deals between France and Spain. A treaty of 27 June 1900 divided Spain's Rio de Oro colony from French West Africa. A second treaty, on 3 October 1904, extended that line north to what is now the Algerian tripoint and then west along 27°40′N, creating the Spanish territory of Saguia el-Hamra. The 1905 French agreement then gave Algeria a short frontier with it. France and Spain confirmed the whole boundary by treaty on 19 December 1956 and marked it with pillars in 1957. The result is a straight north–south line of 41 km, linking the Moroccan and Mauritanian tripoints.
The territory on the other side has been disputed since Spain withdrew in 1975. Under a 1975 agreement with Spain, Morocco took the northern two-thirds and Mauritania the south; when Mauritania withdrew in 1979, Morocco annexed its zone too. The Polisario Front, which proclaimed the Sahrawi Arab Democratic Republic, also claims all of it. Since a 1991 ceasefire Morocco has controlled the area west of its defensive Berm, roughly 80% of the territory, and the Polisario the strip to the east, including the whole frontier with Algeria. Algeria opposed the annexation, and since 1975–76 it has hosted the Sahrawi refugee camps in Tindouf Province, where most of the original refugees still live. Our Western Sahara guide sets out the competing claims in more detail.
1919 and 1956: the Libyan frontier from Ghadames to Ghat
Libya's border was set by two colonial powers. Italy invaded Ottoman Tripolitania in September 1911, and the Treaty of Ouchy in 1912 transferred sovereignty to Rome. France and Italy then signed a treaty on 12 September 1919 delimiting the boundary between Algeria and Libya. After the Second World War, Libya was split between British and French occupation zones before becoming independent in December 1951. France was unhappy with parts of the line, and a treaty with the new Libyan state in 1955–56 altered the section between Ghadames and Ghat to make it easier to administer.
The 989 km frontier runs from the Tunisian tripoint to Niger, past the Algerian towns of Debdeb and In Amenas and the Libyan oases of Ghadames and Ghat. Relations between the governments have mostly been cordial, but the border has been insecure since the Libyan Civil War. On 16 January 2013 militants linked to al-Qaeda seized the Tigantourine gas facility near In Amenas. When Algerian special forces stormed the site four days later, at least 39 foreign hostages had been killed.
1963: the Sand War and the 1972 boundary treaty with Morocco
The undefined desert south of Figuig became a war within fifteen months of Algerian independence. Morocco claimed parts of the Tindouf and Béchar regions as part of a "Greater Morocco". Fighting began on 25 September 1963, when Moroccan forces occupied the border posts of Hassi Beida and Tindjoub. Morocco then pushed towards Tindouf. A ceasefire on 30 October 1963 was monitored by the Organisation of African Unity, its first such mission, and a peace treaty followed on 20 February 1964.
Agreements in 1969–70 led to the treaty of 15 June 1972, which demarcated the entire boundary for the first time. Algeria ratified it in 1973; Morocco did not do so until 1992. The settled line runs south from the Mediterranean, bends sharply west near Figuig, follows the Draa River for a stretch and ends in a straight 116 km north–south run to the Western Sahara tripoint.
Agreeing the line did not open it. Algeria closed the border in 1994 as relations broke down during its civil war, and it has stayed closed. Travel and trade between the two countries must go by air or sea, and clandestine crossings, especially for smuggling, continue. On 24 August 2021 Algeria cut diplomatic relations with Morocco. Two months later it let the contract for the Maghreb–Europe Gas Pipeline, which crossed Morocco to Spain, expire on 31 October 2021. Our Morocco vs Algeria comparison sets the two countries side by side.
Since 2017: migrants, drones and policing the desert lines
The southern borders drawn in 1905 now carry a different kind of traffic. Increasing numbers of African migrants heading for Europe cross the Niger frontier. From 2017 Algeria policed it more tightly and drew criticism after deported migrants were left at the remote border without supplies. Along the Mali border, Algeria has strengthened its military presence since the Mali War began. On 31 March 2025 Algeria shot down a Malian military drone near Tinzaouaten, and in September 2025 Mali took Algeria to the International Court of Justice over the incident. A frontier fixed by two French officers in 1905 has become the setting for a case at the International Court of Justice.
