The maritime pine is native to the southwest and southern Europe, North Africa in Morocco, and along the border between Algeria and Tunisia. It is mainly a pine of low, coastal plains, usually on sandy soils of sea shore dunes; however, in Morocco this species can grow in mountains to an elevation of near .