CAIRO, March 17 (Reuters) - 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.

Photo from Reuters