Germany has elected former civil rights activist and Lutheran pastor Joachim Gauck as its president, in the wake of his predecessor’s corruption scandal which greatly tarnished the office.

Christian Wulff, the former president, resigned after serving only 20 months in office of a five-year term due to a financial scandal that prompted questions over the role of the largely ceremonial office.

Gauck, 72, who is not affiliated with any political party, defeated his only opponent in the German Parliamentary election by a wide margin: 991 out of 1,232 votes at a special assembly of MPs.

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, Gauck said.

Although he received the endorsement of Chancellor Angela Merkel's centre-right Christian Democrat party and all of the other mainstream German political parties, it remains uncertain how well he will get along with Merkel herself.

Merkel, also from East Germany and the daughter of a Protestant pastor, was quick to congratulate Gauck on his recent election and the two reportedly have a good personal relationship.

“The East Germans have arrived but there is still much to do in terms of German unity, she said in a statement.

However, Merkel and Gauck have not always shared the same political views.

The role of the presidency is largely ceremonial in Germany; indeed, the Chancellor holds all the real power and political clout. So while Merkel will not have to worry about a power struggle with the new president, Gauck's tendency to speak his mind and openly criticize the government over certain policy issues may at the very least, as Reuters reported, pose a potential political headache for Merkel.

Moreover, Merkel had supported Wulff for the presidency in favor of Gauck when they ran against one another in 2010.

The German newspaper SpeigelOnline speculated that it remains to be seen whether Gauck’s willingness to learn or his ego will dictate his performance as president.

Similarly, the Sueddeutsche Zeitung publication praised Gauck’s preacher-like emotionalism, but warned this quality may rankle Merkel.

His thoughts and words and sometimes even his actions are guided by emotions. As president he will be difficult to predict, he will irritate people, wrote an opinion price in the paper.

Meanwhile, Gauck faces the challenge of restoring the reputation of the German presidency, following Wulff’s embarrassing fall from grace.

He has an activist past, including leading a much lauded effort to publicize the files of the former East German secret police, the Stasi.