The Spanish mainland is bordered to the south and east almost entirely by the Mediterranean Sea (except for a small land boundary with Gibraltar); to the north by France, Andorra, and the Bay of Biscay; and to the west by the Atlantic Ocean and Portugal. With an area of 504,030 km², Spain is the second largest country in Western Europe (behind France) and with an average altitude of 650 m, the third highest country in Europe (behind Switzerland and Austria).