Morocco is the northwesternmost country in the Maghreb region of North Africa. It overlooks the Mediterranean Sea to the north and the Atlantic Ocean to the west, and has land borders with Algeria to the east, and the disputed territory of Western Sahara to the south. Morocco also claims the Spanish exclaves of Ceuta, Melilla and Peñón de Vélez de la Gomera, and several small Spanish-controlled islands off its coast. It spans an area of 446,300 km2 or 710,850 km2, with a population of roughly 37 million.
Morocco has a wide range of biodiversity. It is part of the Mediterranean basin, an area with exceptional concentrations of endemic species undergoing rapid rates of habitat loss, and is therefore considered to be a hotspot for conservation priority. Avifauna are notably variant. The avifauna of Morocco includes a total of 454 species, five of which have been introduced by humans, and 156 are rarely or accidentally seen.
The Barbary lion, hunted to extinction in the wild, was a subspecies native to Morocco and is a national emblem. The last Barbary lion in the wild was shot in the Atlas Mountains in 1922. The other two primary predators of northern Africa, the Atlas bear and Barbary leopard, are now extinct and critically endangered, respectively. Relict populations of the West African crocodile persisted in the Draa river until the 20th century.
The Barbary macaque, a primate endemic to Morocco and Algeria, is also facing extinction due to offtake for trade human interruption, urbanisation, wood and real estate expansion that diminish forested area – the macaque's habitat.
Trade of animals and plants for food, pets, medicinal purposes, souvenirs and photo props is common across Morocco, despite laws making much of it illegal. This trade is unregulated and causing unknown reductions of wild populations of native Moroccan wildlife. Because of the proximity of northern Morocco to Europe, species such as cacti, tortoises, mammal skins, and high-value birds are harvested in various parts of the country and exported in appreciable quantities, with especially large volumes of eel harvested – 60 tons exported to the Far East in the period 2009‒2011.
Morocco is home to six terrestrial ecoregions: Mediterranean conifer and mixed forests, Mediterranean High Atlas juniper steppe, Mediterranean acacia-argania dry woodlands and succulent thickets, Mediterranean dry woodlands and steppe, Mediterranean woodlands and forests, and North Saharan steppe and woodlands. It had a 2019 Forest Landscape Integrity Index mean score of 6.74/10, ranking it 66th globally out of 172 countries.