The two countries have “reached a definitive deal for the reopening of the land borders with Ceuta and Melilla in the coming days”, Spanish Foreign Minister José Manuel Albares told journalists in the Moroccan city of Marrakesh, without setting an exact date.
The move helps draw a line under a major diplomatic standoff on the back of coronavirus restrictions that together closed the crossings for two years.
The borders became hostage to a major dispute last year when Madrid allowed the leader of a Western Saharan independence movement to be treated for Covid-19 in a Spanish hospital.
Ten thousand migrants surged across the Moroccan border into Ceuta as local border forces looked the other way, in what was widely seen as a punitive gesture by Rabat.
In March, Spain moved to end the diplomatic crisis with Morocco by removing its decades-long stance of neutrality and backing the kingdom’s autonomy plan for the Western Sahara, which Rabat insists must remain under its sovereignty.
Spanish Prime Minister Pedro Sánchez visited King Mohammed VI in early April.
The Spanish foreign minister’s announcement comes a month after a Spanish ferry docked in Morocco’s Tangiers port for the first time in two years.