CAIRO - The European Union announced a 7.4 billion euro ($8.1 billion)funding package and an upgraded relationship with Egypt on Sunday, part of a push to stem migrant flows to Europe criticised by rights groups.

The agreement lifts the EU's relationship with Egypt to a "strategic partnership" and was unveiled as a delegation of leaders visited Cairo. It is designed to boost cooperation in areas including renewable energy, trade and security, while delivering grants, loans and other funding over the next three years to support Egypt's faltering economy.

The proposed funding includes 5 billion euros in concessional loans and 1.8 billion euros of investments, according to a summary published by the EU. Another 600 million euros would be provided in grants, including 200 million euros for managing migration.

Such deals were "the best way to address migratory flows", said Italian Prime Minister Giorgia Meloni, who travelled to Cairo alongside EU Commission President Ursula von der Leyen, the Greek, Austrian and Belgian prime ministers, and the Cypriot president.

European governments have long been worried about the risk of instability in Egypt, a country of 106 million people that has been struggling to raise foreign currency and where economic adversity has pushed increasing numbers to migrate.

Inflation is running close to record highs and many Egyptians say they struggle to get by. Over the past month, however, financial pressure has eased as Egypt struck a record deal for Emirati investment, expanded its programme with the IMF, and sharply devalued its currency.

Diplomats say Egypt's strategic importance has been underscored by the war in Gaza, where Egypt is trying to mediate between Israel and Hamas and increase deliveries of humanitarian aid; and by the conflict in neighbouring Sudan, which has created the world's biggest displacement crisis.

Speaking alongside Egyptian President Abdel Fattah al-Sisi, von der Leyen said it was critical to rapidly reach a Gaza ceasefire deal. Both leaders warned against an Israeli incursion into Rafah, where much of Gaza's population has been displaced.

Egypt says it has lined up a total of $20 billion in multilateral support after increasing its loan and economic reform programme with the IMF.

Most of the EU funding is newly allocated and was drawn up in close cooperation with the IMF, with 1 billion euros of the "macro-financial" loan funding to be delivered this year, a senior EU official said.

The remaining 4 billion euros are subject to approval by the European parliament, the official added.

CROSSINGS VIA LIBYA

Egypt largely shut off irregular migration from its north coast in 2016, but more recently there has been a surge in Egyptians trying to cross to Europe via Libya, and the EU is already providing support aimed at reducing those flows.

In recent months, the Greek islands of Crete and Gavdos have seen a steep rise in migrant arrivals, mostly from Egypt, Bangladesh and Pakistan.

"We must prevent the opening of new migration routes and we will work very closely with Egypt to ensure that this will be achieved," said Greek Prime Minister Kyriakos Mitsotakis, adding that both countries would try to open up legal pathways on migration.

Activists have criticised Western backing for Sisi, who came to power a decade ago after leading the overthrow of Egypt's first democratically elected leader.

A crackdown has swept up dissidents from across the political spectrum, while the state and the army have extended their grip on the economy, which businesspeople and analysts say has impeded structural reforms demanded by the IMF.

Sisi's backers say security measures were needed to stabilise Egypt and pave the way for providing social rights such as housing and jobs.

The EU says its expanded partnership with Egypt is meant to promote democracy and freedoms, but its moves to offer financing in return for migration curbs in other countries including in Tunisia have run up against obstacles and criticism.

"The blueprint is the same as the flawed EU deals with Tunisia and Mauritania: stop migrants, ignore abuses," Human Rights Watch said.

($1 = 0.9185 euros)

(Reporting by Patrick Werr, Andrew Gray, Crispian Balmer, Philip Blenkinsop and Renee Maltezou; Writing by Aidan Lewis; Editing by Nick Zieminski, Frances Kerry and David Holmes)