Which Countries Border Spain?

A map situating Spain within Europe.
A map situating Spain within Europe.

Spain has a total land border of 1,191.7 miles long that is shared by five countries: Morocco, Andorra, France, Portugal, and Gibraltar. The country also borders the Mediterranean Sea, the Bay of Biscay and the Atlantic Ocean. Portugal borders the country in the west, Gibraltar in the south, France and Andorra in the northeast while Morocco is bordered by Spain’s autonomous cities of Melilla and Ceuta. Of these countries, Portugal has the longest border with Spain, stretching 754 miles, while Gibraltar has the shortest, with a length of only 0.75 miles. Additionally, the country has an enclave known as Llivia that is situated inside France. The country has numerous border crossing points along its entire international border. The Spanish province of Ourense has the most crossing points, the majority of which being rural tracks.

Spain-Portugal Border

The “La Raya” is the international land border shared between Spain and Portugal. With a length of at least 754 miles, the border is the longest of its kind in the European Union. However, the two countries recognize different lengths of the border. Portugal defines the border as being 754 miles in length, while Spain states that the border is 765 miles in length. The difference of 11 miles stems from Olivenza, a region which is claimed both by Portugal and Spain, in a territorial dispute that goes back 200 years. In Portugal, this border is referred to as “The Stripe” (A Raia). Spain has seven provinces found along the border; Ourense, Badajoz, Pontevedra, Zamora, Huelva, Caceres and Salamanca Provinces, while Portugal has ten districts along the border which are Faro, Beja, Evora, Portalegre, Castelo Branco, Guarda, Braganca, Vila Real, Braga, and Viana do Castelo.

History Of Spain-Portugal Border

The Spain-Portugal border was demarcated as a result of numerous treaties signed over the course of the nation’s history. The earliest of these treaties was the 1143 Treaty of Zamora which resulted in the formation of Portugal, and its international borders. The most recent of the agreements is the 1926 Convention of Limits. However, the most important agreement was the 1297 Treaty of Alcanices that saw the delineation of most of the country’s modern international borders. The treaty also makes the border among the oldest in the world. The treaty was signed by Kings Denis and Fernando IV of Portugal and Castile respectively.


Olivenza is a region along the Spain-Portugal border whose ownership is disputed by the two countries. According to Spain, the region is part of the country’s Extremadura autonomous community, while Portugal believes the town to be part of its Province of Alto Alentejo. Nonetheless, the administration of Olivenza is done by the Spanish government. The region covers an area of 290 square miles and is home to an estimated population of 11,512 people. Portugal claimed the region since 1297 but had the sovereignty of the town taken by Spain in the aftermath of the 17th century War of Oranges and the signing of the 1801 Treaty of Badajoz.

Spain-France Border

France borders the northern part of Spain. The Spain-France border is the second-longest international border of all Spain’s bordering countries. The border starts at the Bay of Biscay near the towns of Hendaye and Irun and runs eastwards until it touches the Mediterranean Sea near the towns of Portbou and Cerbere, stretching a total length of 407.8 miles. The border is, however, interrupted by Andorra for some 30 miles. Ariege, Haute-Garonne, Pyrenees-Orientales, Haute-Pyrenees and, Pyrenees-Atlantiques are the five departments of France along which the border runs. In Spain, the border runs through five provinces which are Lleida, Gipuzkoa, Girona, Huesca and Navarre provinces.

History of Spain-France Border

The border was first established in the Treaty of the Pyrenees, signed by the kingdoms of France and Spain in 1659. There were other agreements made between the two kingdoms over the years concerning the border. Several treaties that best outline the current border were made in the mid-19th century known as the Bayonne Treaties. These treaties were made between Napoleon III of France and Spain’s Queen Isabel II, commencing with the 1856 Treaty and ending in the 1868 Final Acts of Limits.

Spain-Gibraltar Border

The British Territory of Gibraltar also shares a land border with Spain, which is 0.75 miles in length. Also known as “La verja de Gibraltar” (The Fence of Gibraltar), the border separates Gibraltar from La Linea de la Concepcion, a municipality of Spain. The border was established as a result of the 1713 Treaty of Utrecht, signed by the Kingdom of Spain and Great Britain. However, Spain maintains that it does not recognize the border, claiming sovereignty over Gibraltar. The border features a 7-foot tall fence that was built in 1909 by Great Britain. The recent vote by the UK to leave the European Union, popularly known as Brexit is expected to affect the operations of the border.

Andorra and Morocco

Andorra lies along the Spain-France border and shares a land border with Spain stretching 39.58 miles. The most significant issue faced along the border is the smuggling of contraband items, mainly tobacco which is found at low prices in Andorra. Despite being situated on a different continent, Spain also shares a land border with Morocco stretching 11.8 miles, through Penon de Velez de la Gomera, and the autonomous towns of Melilla and Ceuta, which are all part of Spain’s territory. The de facto border between Morocco and the two autonomous cities lies on “no man’s land,” stretching 11.79 miles.


A Spanish town known as Llivia is particularly interesting. The town is defined as an enclave as France’s department of Pyrenees-Orientales surrounds it. The town is one mile away from the Spain-France border and covers an area of five square miles. The town was established as part of Spain’s territory in the Treaty of Llivia in 1670, as the agreement imposed that all villages in the region be part of France, but Llivia was exempted as it was then a villa and not a village, ending up as part Spain’s territory. The town’s location within France prevents Spain from having a military presence on the town.


More in World Facts