Chancellor Angela Merkel's Bavarian allies suffered their worst election result since 1950 on Sunday, bleeding votes to the far-right in a setback that risks widening divisions within Germany's crisis-prone national government.

The Christian Social Union (CSU) won 35.5 percent of the vote, an exit poll for broadcaster ARD showed, losing its absolute majority for only the second time since 1962 - an outcome sure to stoke infighting in the party, already a difficult partner for Merkel in Berlin.

The result, which saw the pro-immigration Greens come second and the far-right Alternative for Germany (AfD) enter the state assembly for the first time, means the CSU will need to form a coalition - a humiliation for a party used to ruling alone.

CSU leader Horst Seehofer has been a thorn in Merkel's side since her 2015 decision to open Germany's borders to more than 1 million migrants, gradually shifting his party to the right in an ultimately futile effort to counter the rise of the AfD.

Divisions between Merkel's Christian Democratic Union and the CSU - conservative sister parties - have widened further since an inconclusive national election forced them into a coalition in March with the left-leaning Social Democrats (SPD).

The Bavarian election is followed in two weeks by another test for Merkel's conservative alliance: her CDU is likely to remain the largest party but lose votes in a regional vote in the western state of Hesse, home to the financial centre of Frankfurt.

The CDU then holds its annual congress in December, when Merkel will seek re-election as party chairwoman - a bid senior conservatives have backed despite the parliamentary party ousting her ally, Volker Kauder, as leader last month.

Before the Bavarian vote, Merkel urged her CDU and CSU allies to end their in-fighting.

Her fourth and probably final government has already come close to collapsing twice, in arguments over immigration and a scandal over Germany's former domestic spymaster, while a simmering row over phasing out polluting diesel cars now threatens to boil over.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.