BERLIN (Reuters) - Germany said on Monday it had reached a deal with Egypt to stem the flow of migrants from the Arab country, part of a broader push by Berlin to head off waves of migrants that have stoked domestic political tensions.

The arrival in Germany of a million refugees over the last two years, mainly from Syria and Iraq, opened deep rifts in Chancellor Angela Merkel’s conservative party and is becoming a campaign theme ahead of a Sept. 24 national election.

Merkel and the European Union have already sealed a migrants deal with Turkey to stem the flow from the Middle East and her spokesman, Steffen Seibert, said the Egypt deal would “fight illegal immigration and the criminal smuggling of people”.

“Under this agreement, there are a number of measures for political and economic support so that a better climate and better living conditions can be achieved for refugees in Egypt,” Seibert told a regular government news conference in Berlin.

“Together, we will set up a center for jobs, migration and reintegration”, he added. This center would be in Egypt, a transit country for migrants striving to reach Europe.

In Paris, meanwhile, French President Emmanuel Macron prepared to host a summit of Europe’s “big four” continental powers including Germany, as well as three African nations to tackle Europe’s migrant crisis. Libya, Chad and Niger are all transit nations for migrants bound for Europe.

Since Turkey and the EU reached an agreement a year ago to curb the flow of migrants and refugees sailing from Turkish shores to Greece, most migrants have taken the more dangerous route from North Africa to Italy.

In Libya, people traffickers have operated with relative ease, but many migrants and refugees also set off from Egypt.

Merkel said in a weekend newspaper interview she has no regrets about her 2015 decision to open Germany’s borders to hundreds of thousands of refugees and added she will not be deterred from campaigning by angry hecklers.

Seeking a fourth term, Merkel has had to contend with loud and sustained heckling on her campaign trail from demonstrators strongly opposed to her refugee policies.