Spain is the only country that shares a land border with Portugal.
The Portugal–Spain border, often called the A Raia or La Raya, runs for approximately 1,214 kilometres across the Iberian Peninsula. It is one of the oldest borders in Europe, with much of its present course shaped by medieval treaties and later agreements between the two kingdoms.
Portugal occupies the western edge of the peninsula, while Spain surrounds it on the north, east and south, apart from Portugal's Atlantic coastline. Spain therefore has Portugal as its only mainland neighbour on the western side, although Spain also borders France and Andorra in the Pyrenees and has borders associated with territories in North Africa.
Portugal's island regions, the Azores and Madeira, have no land borders. The two Iberian countries are members of the European Union and the Schengen Area, so their land frontier is generally crossed without routine passport controls, though national and European rules can change.