Spain is not surrounded by land masses. It occupies ~85% of the Iberian Peninsula, sharing land borders only with:
Its remaining boundaries are maritime: Atlantic Ocean (northwest, southwest) and Mediterranean Sea (east, southeast). The Balearic and Canary Islands are Spanish territories surrounded by water.