The internationally recognized borders of the country lie between latitudes 27° and 36°N, and longitudes 1° and 14°W. Adding Western Sahara, Morocco lies mostly between 21° and 36°N, and 1° and 17°W (the Ras Nouadhibou peninsula is slightly south of 21° and west of 17°).
The geography of Morocco spans from the Atlantic Ocean, to mountainous areas, to the Sahara (desert). Morocco is a Northern African country, bordering the North Atlantic Ocean and the Mediterranean Sea, between Algeria and the annexed Western Sahara.
A large part of Morocco is mountainous. The Atlas Mountains are located mainly in the center and the south of the country. The Rif Mountains are located in the north of the country. Both ranges are mainly inhabited by the Berber people. At 172,402 sq mi (446,519 km2), Morocco is the fifty-seventh largest country in the world (after Uzbekistan). Algeria borders Morocco to the east and southeast though the border between the two countries has been closed since 1994.
Spanish territory in Morocco comprises four enclaves on the Mediterranean coast: Ceuta, Melilla, Peñón de Vélez de la Gomera, Peñón de Alhucemas, the Chafarinas islands, and the disputed islet Perejil. Off the Atlantic coast the Canary Islands belong to Spain, whereas Madeira to the north is Portuguese. To the north, Morocco is bordered by and controls part of the Strait of Gibraltar, giving it power over the waterways in and out of the Mediterranean sea.
The Rif mountains occupy the region bordering the Mediterranean from the north-west to the north-east. The Atlas Mountains run down the backbone of the country, from the south west to the north east. Most of the south east portion of the country is in the Sahara Desert and as such is generally sparsely populated and unproductive economically. Most of the population lives to the north of these mountains, while to the south is the desert.
To the south, lies the Western Sahara, a former Spanish colony that was annexed by Morocco in 1975 . Morocco claims that the Western Sahara is part of its territory and refers to that as its Southern Provinces.