Germany's government and the two major opposition parties are to jointly nominate former East German human rights activist Joachim Gauck to be the country's next president.
Mr Gauck, 72, is a former Lutheran priest who opposed East Germany's then-communist regime and became head of a government agency dealing with the painful past of the party's ubiquitous domestic intelligence service after Germany's reunification in 1990.
Chancellor Angela Merkel told a hastily called news conference her centre-right coalition government and the centre-left opposition rallied behind Mr Gauck, who was initially proposed by the opposition Social Democrats and Greens. He is not a member of any political party.
"What moves me the most is that a man who was still born during the gloomy, dark war, who grew up and lived 50 years in a dictatorship... is now called to become the head of state," Mr Gauck said. "This is of course a very special day in my life."
Ms Merkel, who also grew up in East Germany, said their life stories strongly connected them. "We have both spent a part of our life in the GDR and our dream of freedom has become true in 1989," she said.
The chancellor stressed that clergymen such as Mr Gauck were at the forefront of the protests that eventually brought down the communist regime.
Christian Wulff, 52, quit as president on Friday after prosecutors asked parliament to strip him of his immunity from prosecution over accusations of improper ties to businessmen.
The move followed two months of claims that he received favours and hotel stays when he was state governor of Lower Saxony.
Mr Wulff was Ms Merkel's candidate when elected less than two years ago, triumphing at that time over Mr Gauck in a messy election.
Opposition leader Sigmar Gabriel made a jibe at Ms Merkel at their joint news conference at Berlin's chancellery, saying "it is now evident that all involved regret that Joachim Gauck failed to get elected (in 2010), therefore it is good that we now have him as joint candidate".