MUNICH/BERLIN (Reuters) - Chancellor Angela Merkel’s conservatives and their Bavarian allies agreed to support her candidacy for elections pitting her against re-invigorated Social Democrats (SPD) to lead Germany through a time of great political uncertainty in Europe.

A poll issued on Monday showed the SPD, currently junior partners in a grand coalition under Merkel, would triumph if an election set for September were held today. It was the first time in years the SPD, which last won an election in 2002, has outflanked the CDU and follows installation of a new leader.

Merkel was elected Germany’s first female Chancellor in 2005 and has emerged as arguably the most powerful political figure in Europe at a time when the European Union has faced deep economic and political problems.

Merkel’s Christian Democrats (CDU) and Horst Seehofer’s Christian Social Union (CSU) have been embroiled in a bitter dispute over how to tackle an influx of more than a million migrants over the last two years and they have bled support to the anti-immigrant Alternative for Germany (AfD).

Seehofer, who has been vociferous in his criticism of Merkel’s open-door policy, insists on introducing a cap on new arrivals but Merkel opposes the idea - though she made overtures towards the CSU on Monday by stressing that there “must be no repeat” of 2015 when a record 890,000 migrants arrived here.

She also said deporting rejected asylum seekers needed to be a “top priority” but the parties agreed to disagree on restricting arrivals.

“We have differing views on the migrant cap and we’ve decided to respect each other’s positions in that disagreement without glossing over our differences,” Merkel said at a joint news conference with Seehofer.

MIGRATION ISSUE

Seehofer, who called Merkel an “excellent chancellor”, said the disagreement would not prevent the conservative sister parties from teaming up for the 2017 election which Merkel again said would be the “toughest that I have ever experienced”.

“We’re all in, we want to win the election!” Seehofer said, adding that this was necessary to prevent a left-wing coalition of the center-left SPD, far-left Linke and Greens from taking power.

The SPD has gained ground since nominating former European Parliament President Martin Schulz as its candidate for chancellor. A poll by the INSA organization for Bild newspaper put the SPD on 31 percent, and the conservatives on 30 percent.

The AfD was projected third with 12 percent, followed by the hard-left Die Linke on 10 percent.

The SPD’s choice of Schulz has unnerved the conservatives, with senior CDU member Jens Spahn telling broadcaster n-tv that the appearance of a “Messiah” for the SPD had made the conservatives realize: “There’s something at stake here.”

Seehofer said he and Merkel had agreed that it was necessary to tackle the root causes of migration, repatriate some migrants and reach deals with third countries.

The party leaders agreed their election campaign would focus on domestic and external security, family policy, social cohesion and innovation, though they will only adopt an election program in July.