UPDATE 4-Merkel allies weather far-right surge in German regional elections

* Merkel's CDU comes first in Saxony but far-right AfD gains

* SPD holds off AfD challenge to come first in Brandenburg

* Results avert immediate crisis for Merkel's national coalition (Adds fresh reaction)

By Paul Carrel and Madeline Chambers

BERLIN, Sept 1 (Reuters) - Chancellor Angela Merkel's conservatives and her Social Democrat (SPD) coalition partners held off a surge in far right support in two state elections in eastern Germany on Sunday, averting an immediate crisis for the ruling alliance.

Merkel's Christian Democrats (CDU) remained the largest party in Saxony but saw their vote share drop by 7.4 points from the last election in 2014 to 32%, with the far-right Alternative for Germany (AfD) coming second, preliminary results showed.

The AfD harnessed voter anger over refugees and the planned closure of coal mines in the formerly communist eastern states, casting itself as the heir of the demonstrators who brought about the fall of the Berlin Wall three decades ago.

In Brandenburg, which surrounds Berlin, the left-leaning SPD clung on to first place in a state they have run since German reunification in 1990, winning 27.2% of the vote - ahead of the AfD on 22.8%, preliminary results showed.

The ruling parties' setbacks were not as major as feared and the results alleviate some pressure on the national coalition led by Merkel, who has loomed large on the European stage since 2005, and could reassure a European Union unnerved by Brexit.

"The results are a reminder of how little CDU and SPD would stand to gain from new elections right now. That might help stabilise Merkel's position, at least for now," said Carsten Nickel, managing director at Teneo, a consultancy.

Much depends on the SPD, which rules with the radical Left party in Brandenburg. The party sank into turmoil after its worst performance in European elections in May, is polling close to record lows and is still searching for a leader.

Many SPD rank-and-file members want to quit a ruling national alliance that has supported Merkel for 10 of her 14 years in power and rebuild in opposition.

Thorsten Schaefer-Guembel, one of the SPD's caretaker leaders, said the coalition was working constructively.

"There is no question there are differences on substance ... but it is clear that this coalition will carry on," he told ZDF television, adding the parties were focusing on issues such as an ambitious climate protection package.

PALPABLE RELIEF

CDU and SPD leaders were relieved at holding off the AfD.

"We have done it. This is a message that goes out from Saxony. The friendly Saxony has won," Michael Kretschmer, CDU state premier of Saxony, told supporters to loud applause. "This is a really good day for our state."