MOROCCANS call the vast and arid region along their border with Algeria “the Oriental”. For centuries, trade bustled between their former capital, Fez, and cities on the western side of present-day Algeria, such as Oran. Pilgrims passed through on their way to the Middle East. Ibn Battuta, a great 14th-century Muslim explorer, set off from Tangier, on Morocco's north-western tip, on his 30-year peregrinations that took him as far as China.

Alas, there are no Ibn Battutas today, if only because the border between Morocco and Algeria, which runs for 1,559km (969 miles), or 1,601km if you include a further stretch alongside the disputed Western Sahara, has been closed for nearly 16 years. In 1994 Algeria shut it after Morocco's government imposed visas on Algerian travellers in the wake of a guerrilla attack on the Atlas Asni Hotel in Marrakech, in which the Moroccans suspected Algeria of having a hand. Thousands of Algerian residents and tourists were summarily expelled.

The Western Sahara row has made matters worse. For 35 years, since Spain's departure, the territory has been disputed between the Polisario movement, which wants independence, and the Moroccan government, which has offered autonomy. The Algerians have doggedly backed Polisario. The conflict is barely closer to a resolution, though Morocco has managed to keep Polisario's guerrillas militarily at bay.

Even leaving aside Western Sahara, the Atlas Asni incident is still a big barrier to better relations. It also impedes economic integration between the Maghreb countries in general. The Arab Maghreb Union (AMU), a trade organisation created in 1989 to encourage free trade between Algeria, Libya, Mauritania, Morocco and Tunisia, has failed to hold a summit meeting since 1994, in part because of the Algerian-Moroccan spat. Trade within the AMU quintet accounts for a paltry 2% of what the region conducts with the whole of the rest of the world.

Morocco's King Muhammad VI began trying to break the logjam in 2004, when he let Algerians visit his country without a visa. Algeria's president, Abdelaziz Bouteflika, returned the favour the next year but refused to reopen the border, despite King Muhammad's plea in 2008 and the urging of the United States and the European Union. Algeria may still feel bitter about the expulsion after the hotel attack of 1994 but it is also nervous lest Morocco use the border issue as a lever to get Algeria to back down over Western Sahara. Algeria still insists, to the irritation of Morocco, that there should be a referendum under an international agreement signed in 2003. The unresolved issue has fuelled rivalry for dominance of the wider Maghreb region, in which the two countries are by far the biggest in terms of population: Morocco has 32m people, Algeria 35m.

The benighted borderlands

Moroccan towns such as Oujda, a ten-minute drive from the border, have been hard hit. Despite efforts to reorient the region's economy towards tourism and to draw the area into Morocco's hub on the Atlantic, local unemployment is two-and-a-half times the official national rate of 10%. Remittances from Europe probably provide the region's main source of income: nearly a third of the 3m-plus Moroccans working in the EU hail from the eastern area. Their king recently visited Oujda to launch plans for new factories and infrastructure, implying he could not wait for Algeria to open up. Yet opening the border to trade would plainly bring a boom.

Signs of softening between the two countries are, however, evident. Regardless of politics, businessmen are going their own way. More Algerians now take holidays in jollier Morocco, even if they have to go by air, and Moroccan companies are trying to bring their know-how to Algeria, which is rich in oil and gas but stubbornly hostile to markets and global business. Since 2007 the intelligence services of both countries have held regular meetings on counter-terrorism, in view of a shared threat from jihadists. And AMU officials have agreed to set up a Maghreb Customs Co-operation Council with headquarters in Algiers and a training centre in Morocco's commercial capital, Casablanca. A UN man calls it “the most important move in years towards reconciliation.”