The European Union's only land border with Africa had been closed due to the COVID-19 pandemic and a diplomatic crisis between Madrid and Rabat.
The land borders between Morocco and the Spanish enclaves of Ceuta and Melilla have reopened for the first time in over two years.
Queues of people and traffic gathered at Tarajal and Beni Enzar to witness the reopening at midnight.
The EU's only land borders with Africa have long been closed due to the COVID-19 pandemic and a diplomatic crisis between Madrid and Rabat.
Crossings have been initially limited to residents of Europe’s passport-free Schengen area and their family members and will be expanded to cross-border workers by the end of May.
Melilla regional President Eduardo de Castro told Spanish state radio RNE that it may take "several months" for customs controls to be re-established.
Ferry traffic between the two neighbouring countries resumed several weeks ago on 12 April.
Spain and Morocco have moved to mend relations after a years-long dispute over the disputed region of Western Sahara, a former Spanish colony annexed by Morocco in 1976.
The row escalated when Madrid allowed the leader of Western Sahara’s pro-independence movement to be treated for COVID-19 at a Spanish hospital.
In retaliation, Morocco appeared to ease border controls at Ceuta in May 2021, allowing thousands of migrants to cross into Spain.
But tensions began to thaw earlier this year after Spain backed Morocco’s plan to grant more autonomy to Western Sahara.
The local economies on both sides of the fences depend heavily on the crossings of goods and workers.