Spain has of borders, with 5 countries.

Borders

Spain–Portugal border

The Spain-Portugal border, commonly known as La Raya, is 1,292 kilometers long. It extends through the provinces of Pontevedra, Ourense, Zamora, Salamanca, Cáceres, Badajoz and Huelva in Spain, and the districts of Viana do Castelo, Braga, Vila Real, Bragança, Guarda, Castelo Branco, Portalegre, Évora, Beja, Faro in Portugal.

Borders of Spain

The border starts in the mouth of Minho River, and ends in the mouth of Guadiana River.

Borders of Spain

Spain-France border

The Spain-France border is 656.3 km long. It is divided in two parts, since it is interrupted by Andorra. The first part extends through the provinces of Gipuzkoa, Navarre, Huesca, Lleida and Girona in Spain, and the departments of Pyrénées-Atlantiques, Hautes-Pyrénées, Haute-Garonne, Ariège, Pyrénées-Orientales in France.

Borders of Spain

The border goes from the mouth of Bidasoa River to a cape between Cerbère and Portbou, and crosses the Pyrenees.

Spain–Andorra border

The Spain-Andorra border is 63.7 km long. It extends through the province of Lérida in Spain, and the parishes of La Massana, Andorra La Vella, Sant Julià de Lòria, Escaldes-Engordany and Encamp.

This border is a hotspot for smuggling, because of the cheapness of tobacco in Andorra.

Spain–Morocco border

The autonomous cities of Ceuta and Melilla, and the Peñón de Vélez de la Gomera make the border with Morocco, which is 19 km long.

The borders of Ceuta and Melilla, are de facto, because between them and Morocco there is no man's land. The only real border would be the 27 meters long one in the Peñón de Vélez de la Gomera.

Spain–Gibraltar border

The Spain–Gibraltar border is 1.2 km long and connects the British Overseas Territory of Gibraltar and the Spanish municipality of La Línea de la Concepción.

Crossing points

Basque Country

Province of Gipuzkoa

Navarre

Aragon

Province of Huesca

Catalonia

Province of Lleida

Province of Girona

Galicia

Province of Pontevedra

Province of Ourense

Castile and León

Province of Zamora

Province of Salamanca

Extremadura

Province of Cáceres

Province of Badajoz

Andalusia

Province of Huelva

Province of Cádiz

Ceuta

Melilla