THREE characteristics define Egypt, claimed Gamal Abdel Nasser, its charismatic former president. The country is Arab and Muslim, to be sure. But the third feature, Nasser implied, is not as well recognised. “Can we possibly ignore the fact that there is an African continent that fate decreed us to be part of?” he asked. Nasser embraced Africa, fostering leaders who sought to emulate his Egyptian revolution.

More recently, though, Egypt has withdrawn from the continent. The relationship turned sour when Hosni Mubarak, Egypt’s then president, was almost assassinated in Ethiopia in 1995. For the next 16 years Mr Mubarak shunned African summits. When he was finally booted out of office in 2011, the country’s Africa policy involved little more than quarrelling over water. But after years of upheaval, Egypt is beginning to re-engage with the continent.

The renewed attention is a matter of pride and self-interest. Uncomfortable with its decline on the world stage, Egypt aspires to reclaim the status that it had under Nasser. In the Middle East, where it has been eclipsed by wealthier neighbours, this is unrealistic. But it boasts the most powerful army and third-largest economy in Africa, where it has much to gain, starting with business.

To get a sense of how much Egypt has withdrawn from Africa, consider that its trade on the continent accounts for less than 3% of its total, according to Vinaye Ancharaz of the Swiss-based International Centre for Trade and Sustainable Development. Apart from its neighbour Libya, no African country is among Egypt’s top 15 export markets (see chart). Nigeria, the continent’s largest economy, buys just 0.3% of what Egypt sells abroad, whereas it purchases more from 40 other countries, including such faraway minnows as Andorra and Barbados. Poor infrastructure and logistics, and a tendency for African countries to stick with historical trade partners, explain some of this. But Leila Mokaddem of the African Development Bank notes that the situation has not changed in the past decade. Whereas Egypt’s trade has grown, the proportion going to Africa has hardly budged. “There is a lot of room for improvement,” she says, not least because Egypt sells things that Africans want, such as pharmaceuticals, and the cement and steel needed to build infrastructure. Abdel Fattah al-Sisi, Egypt’s president, is focused on attracting investment, but his embrace of the continent has been well received by business. “We can see that the government wants to encourage collaboration with Africa,” says Ahmed Heikal of Qalaa Holdings, an Egyptian firm that invests in Africa. A much-touted investment conference in the resort city of Sharm el-Sheikh on March 13th-15th will feature ten African heads of state. In May 26 African countries, including Egypt, are expected to launch a new free-trade area in Cairo. Tariffs will remain unreasonably high and implementation will be a nightmare, but it is a start. The progress is surprising considering the early tensions in Mr Sisi’s relations with Africa. As punishment for his overthrow of Muhammad Morsi, Egypt’s first democratically elected president, in 2013, the African Union suspended Egypt for almost a year. This was not just a sign of disrespect, in Mr Sisi’s view, but a failure of African leaders to recognise the threat of the Muslim Brotherhood, of which Mr Morsi was a member. Since returning to the fold, Mr Sisi has tried to convince his African colleagues of the dangers of political Islam.

Egypt’s involvement in Libya’s civil war is a reflection of Mr Sisi’s ideology. Along with the United Arab Emirates (UAE), Egypt has backed the somewhat secular eastern government, while Qatar and Turkey support its Islamist-aligned rival in the west. The proxy war is part of a broader struggle in the region between autocrats and Islamists, whom Mr Sisi often misguidedly conflates with terrorists. More welcome has been his call for a “revolution” in Islam aimed at undermining African jihadist groups.

Libya is now in the spotlight, but Egypt’s neighbours to the south have long caused it more grief because of disputes over their use of the Nile, its primary water source. Egypt sits downstream, so has little control over the river’s flow. Nevertheless, it claims most of the water running into its dam at Aswan, based on a treaty it signed with Sudan in 1959. A separate treaty, signed with the British 30 years earlier, ostensibly allows it to block any big upstream projects. When Ethiopia, the source of most of the Nile’s water, began building an enormous hydroelectric dam in 2011, there was talk of war.

The old treaties were clearly unfair, and the dam’s significance was overstated, but the dispute nevertheless poisoned Egypt’s relations with its neighbours. Most countries that share the Nile have signed a new agreement. Egypt is not among them. But whereas Mr Mubarak frothed at African leaders, Mr Sisi has lowered tensions. Last week he won a preliminary deal with Ethiopia on sharing Nile water.

The import of that deal will depend on the specifics, such as how much water Egypt receives, how fast the dam fills and whether the electricity is shared. But the process by which Mr Sisi secured the agreement is typical of his engagement with Africa. He has been flexible and pragmatic. Most important, he has been there, at African summits and engaged with other leaders. That may not raise his profile to the level of Nasser’s, but it may re-establish Egypt’s place on the continent.