In December 2011, allegations emerged concerning Christian Wulff’s former ties with affluent businessmen. While he was still Prime Minister of Lower Saxony, Wulff denied having had any business ties with Egon Geerkens, despite having received a private home loan of about €500,000 from Egon's wife Edith in 2008 and which Geerkens had admitted arranging. On 22 December 2011, Wulff made a public statement apologizing for his handling of the loan affair and conceded that he should have made his personal records available more quickly. Later, it was alleged that President Wulff had applied undue pressure to Springer Press to delay or even prevent initial revelations of the loan scandal. By the beginning of January 2012, President Wulff had already lost public support, commentators were calling for him to resign, the opposition was again increasing pressure, and his own party was distancing itself from him over the allegations. On 4 January 2012, Wulff said in an interview that he wanted to stay in office and that the call to Bild editor Kai Diekmann had been a "serious mistake" that was "unworthy" of a president and for which he had already apologized. As more allegations of possible corruption emerged, the prosecutors in Hanover, the capital city of the state of Lower Saxony, asked the Bundestag to lift Wulff’s presidential immunity in order to investigate the possible granting or accepting of undue favors. Pre-empting this, Wulff resigned on 17 February 2012, explaining that the loss of the people's trust had damaged his effectiveness.
In the days following Wulff's resignation, the media speculated about several candidates, among them Joachim Gauck, Thomas de Maizière and Klaus Töpfer. Chancellor Angela Merkel said she would consult with the Social Democrats and The Greens to find a consensus candidate to replace Wulff. On 19 February 2012, the governing coalition's CDU, CSU, and FDP and the opposition SPD and Greens agreed on independent Joachim Gauck, the 2010 presidential candidate of the SPD and Greens, as their joint candidate. This happened after the FDP, the SPD, and the Greens had strongly supported Gauck and urged CDU to support him as well. The SPD chairman, Sigmar Gabriel, had already stated on 17 February 2012 that Gauck was his party's preferred candidate, alleging that Gauck enjoys "great trust from the citizenry". Reportedly, Merkel conceded to FDP chairman Philipp Rösler's staunch support for Gauck; the agreement was announced after the FDP presidium had unanimously voted for Gauck earlier on 19 February. The Free Voters in Bavaria and the Danish minority party, the South Schleswig Voter Federation, also supported Gauck. On the night of being nominated, Gauck warned Germans that he should not be seen as "Superman" following two successive short-lived presidencies. In the week prior to the election, Die Zeit also said that Gauck could teach Germans that "we can learn that democracy means thinking and acting for one's self rather than waiting for political redeemers."
Voting started at noon. At 14:24 on 18 March 2012, Gauck accepted his election. He was elected in the first ballot with 991 votes in the Federal Convention. Bundestag president Norbert Lammert announced the result. In reaction, Gauck exclaimed: "What a beautiful Sunday", also referring to the anniversary of 18 March 1990 when East Germans had been able to vote freely for the first time.