BERLIN (Reuters) - Chancellor Angela Merkel’s long-time allies in Bavaria are on track for their worst ever performance in October elections, according to a poll on Monday, suggesting their harder line on immigration is failing to lure voters from the far right.

Slideshow ( 4 images )

Only 40 percent of voters would back the Bavarian Christian Social Union (CSU), down from 42 percent in February, a Forsa poll forecast - both startling numbers for a party that has dominated the region for half a century.

Support for the far-right Alternative for Germany (AfD) party rose to 13 percent from 10 percent in February, making it the third largest party in Bavaria, according to the poll.

Disagreements over how to handle migrants in the European Union have widened rifts in the bloc, threatened its free-travel area and, in Germany, piled pressure on Merkel’s fragile coalition government.

The CSU last week gave Merkel days to come up with a European agreement on resettling migrants before CSU Interior Minister Horst Seehofer starts turning refugees back at the border - an ultimatum widely seen as a bid to win over supporters from AfD.

Bavarian premier Markus Soeder also demanded a break with Merkel’s open-borders policy which has seen more than a million refugees reach Germany - a call seen as a direct challenge to the 13-year chancellor’s authority.

The Forsa poll, published after Merkel and other EU leaders failed to come up with a bloc-wide policy on immigration at a conference in Brussels, showed the issue was still top of the agenda in Bavaria.

Three quarters of Bavarian voters disagreed with Seehofer’s view that managing migration was his most important task, according to the poll.

But that did not translate into any surge in support for his party, a jolting result, said analysts.

“They (CSU) were historically Europe’s most effective people’s party, drawing in voters all the way from the right to the center-left,” he said. Only once before has the party had to govern in coalition in Bavaria.

The Social Democrats (SPD), with whom Merkel’s conservative bloc governs in Berlin, have become increasingly critical of the in-fighting to their right, portraying the CSU’s collision course with Merkel as recklessness.