BERLIN - Activist pastor Joachim Gauck became German president by an overwhelming majority Sunday, marking the first time a candidate from the former communist east will serve as head of state.

Gauck claimed 991 votes out of 1,232 from a special assembly of MPs and other dignitaries, parliamentary speaker Norbert Lammert said.

Prominent Nazi hunter Beate Klarsfeld, 73, nominated as a protest candidate by a far-left party, attracted 126 votes while a candidate for the extreme right drew three. “What a beautiful Sunday,” Gauck, 72, said to enthusiastic applause from the chamber of the glass-domed Reichstag parliament building in central Berlin after the vote.

Chancellor Angela Merkel, who also grew up under communism, hailed Gauck’s victory as a sign of how Germany had transformed in the nearly 23 years since the Berlin Wall fell.

“The east Germans have arrived but there is still much to do in terms of German unity,” she said. Gauck helped drive the peaceful revolution that brought down communist East Germany and later fought to ensure that the public would be granted access to the vast stash of files left behind by the despised Stasi secret police after reunification in 1990. He oversaw the archive for the next decade.

“I accept this responsibility with the endless gratitude of a person, who after the long trail of mistakes through the political deserts of the 20th century, finally and unexpectedly found a home again, and who, in the last 20 years, got to experience the happiness of helping to shape a democratic society,” he said.

He noted that his victory fell on the 22nd anniversary of the first free elections in East Germany.

“I will never forget those elections - never,” he said. “I knew then that I would never miss another election.” It was the third presidential election in three years for Germany after the abrupt resignations of Gauck’s two predecessors.

The media and the public cheered Gauck’s candidacy as an opportunity to remove some of the tarnish from the largely ceremonial office which serves as a kind of moral compass for the nation.

Merkel gave her backing to the plain-spoken Lutheran pastor in February after then president Christian Wulff stepped down amid a flurry of corruption allegations dating from his time as a state premier.

Wulff served only 20 months of his five-year term in office.

He had replaced Horst Koehler, a former head of the International Monetary Fund who bowed out after an uproar over comments he made appearing to justify using the military to serve Germany’s economic interests.

Expectations are outsized for the new president, who has won a reputation across the country as an inspiring public speaker.

As a staunch Protestant like Merkel, he is keen to remind Germans that their hard-won freedoms carry weighty responsibilities with them - a lifelong theme he has said he will take to the presidential palace.

Gauck himself warned scandal-weary Germans against seeing him as a redeemer, telling reporters the night he was nominated that they should not expect “Superman.”

He stressed again Sunday that he would “surely not be able to fill all expectations.”

Commentators have noted he could help improve Germany’s image abroad at a time that it has taken a hit over its hardline stance in the eurozone debt crisis.

Gauck told rolling news channel NTV after his election that he hoped his first foreign trip as president would be to Poland.

He looked set to buck tradition from the start, as his longtime girlfriend Daniela Schadt said he had no plans to divorce his estranged wife of more than 50 years, Gerhild, and marry her.

“I see no reason to marry for reasons of protocol,” the 52-year-old journalist who is now Germany’s first lady told the Bild am Sonntag newspaper.

“Considering the fact that not only Jochen and I but the whole family accepts our arrangement, I think the rest of society can live with it,” she said, using Gauck’s nickname.