By Joseph Nasr

MAGDEBURG, Germany (Reuters) - Supporters of Germany's new anti-immigration party erupted into raucous celebrations in this eastern city on Sunday after the Alternative for Germany (AfD) surged into three state assemblies with scores that would have been unthinkable only a year ago.

"What an amazing evening," Andre Poggenburg, the AfD leader in the eastern state of Saxony-Anhalt, said in a fiery speech in the state capital Magdeburg, calling the result "brilliant".

"We fought like lions for your land," he said, dismissing Angela Merkel as "the worst chancellor in the history of Germany."

Formed three years ago in opposition to euro zone bailouts, the AfD has morphed into an anti-immigration party over the past year, kicking out its founder and seizing on a record influx of migrants to lure new voters and steal disaffected members of Merkel's conservatives.

On Sunday they had their best day ever, winning a shocking 24 percent of the vote in Saxony-Anhalt, to become the second-biggest party in the state parliament.

The AfD also performed better than polls predicted in two other states, winning nearly 15 percent in the prosperous southern region of Baden-Wuerttemberg and over 12 percent in Rhineland Palatinate, a western wine-making state.

Exit polls showed that the AfD drew most of their support from people who previously hadn't voted for a party, but they also drew thousands of voters from Merkel's conservatives, particularly in Baden-Wuerttemberg.

While populist, anti-immigrant parties have thrived for years in other European countries, Germany has been an exception, in part because opposition to far-right ideologies runs deep because of the country's Nazi past.

The refugee crisis has changed all that. More than a million migrants entered Germany last year, unsettling many Germans and turning the AfD into a force on the national stage almost overnight.

"MERKEL MUST GO!"

In Magdeburg, about 250 mainly middle-aged supporters whistled, clapped and cheered as results were projected onto a large screen. In Berlin, supporters chanted "Merkel must go!"

"This is democracy. I am very, very happy," said Gerlach Holm, 67, who traveled to Magdeburg from Hamburg to celebrate with party friends. He wore a shirt that read: "My heart beats for Germany"

The AfD narrowly missed the five percent hurdle needed to enter the federal parliament in 2013 but is now represented in the state assemblies of half of Germany's 16 states.

Since outmaneuvering party founder Bernd Lucke last year to seize control of the AfD, 40-year-old chemist Frauke Petry has refocused the party on immigration, delivering fiery speeches attacking Merkel and causing an uproar by saying German police should be given a green light to shoot migrants at the border as a last resort.

"Mrs. Petry went far with those remarks but we are not against foreigners," said Holm. "We need foreigners because we have low birth rates and we are aging. But we need foreigners who integrate."

Despite its success, the party will not get a taste of power after the state elections.

All of Germany's other parties have ruled out forming coalitions with the AfD.

"I did not vote AfD because I expect them to govern," said Thorsten, a 48-year-old sales manager who declined to give his family name saying he fears his employer could fire him. "I voted AfD to protest the federal government's policies."

"I did not ask Mrs. Merkel to open Germany's borders to everybody. It is fine to let in people fleeing conflicts, but not everyone," he said as he sipped a beer with his wife.

But not everyone was happy. At a snack bar across the street, a 41-year-old German man named Nico Braun walked in and said to the Turkish owner: "Are the AfD gone or do I have to say Heil Hitler?"

(Reporting by Joseph Nasr; Editing by Noah Barkin)