|Chancellor Angela Merkel, a fellow east German, threw her support behind Joachim Gauck [AFP]
A former Lutheran pastor and human rights activist has become Germany's new president after legislators voted overwhelmingly for him.
Joachim Gauck was elected president on Sunday, winning the vote by a large majority in the first round of voting.
Gauck comes to office following the resignation of his predecesor Christian Wulff amid corruption charges.
Norbert Lammert, speaker of the lower house of parliament, the Bundestag, said Gauck, 72, had won 991 votes in the federal assembly of national and regional legislators that is charged with choosing Germany's largely ceremonial head of state.
His main rival, former Nazi-hunter and journalist Beate Klarsfeld, won 126 votes.
"What a beautiful Sunday," Gauck 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.
Germans expect Gauck, a prominent member of the peaceful protest movement that led to the fall of the Berlin Wall in 1989, to restore dignity to the presidency, tarnished by financial scandals that felled Wulff and led to his resignation.
Merkel threw her support behind the plain-spoken Gauck in February after Wulff quit amid a flurry of corruption allegations dating from before he took office.
'Dignity and respect'
Wulff only served 20 months of his five-year term in office.
He had replaced Horst Koehler, a former head of the International Monetary Fund who stepped down after an uproar over comments he made appearing to justify using the military to serve Germany's economic interests.
Claudia Roth, co-leader of the opposition Greens party, which also backed Gauck's candidacy, said the country was looking to Gauck to "give this badly damaged office dignity and respect again".
A poll for ARD public television released on Saturday indicated that 80 per cent of respondents consider him to be trustworthy.
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 vast stash of files left behind by the despised Stasi secret police after reunification in 1990. He oversaw the archive for the next decade.
The media and the public have cheered his 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.