Washington

IF everything goes according to plan, on Sunday Germany will swear in Joachim Gauck as its 11th postwar president.

The choice of Mr. Gauck, a pastor known for his anti-Communist activism under the East German government, couldn’t come at a better time. Germany is playing the bad cop in the European Union’s efforts to manage the Continent’s debt crisis, and anti-German sentiment, particularly in southern Europe, is high. That in turn is pushing the German public away from spending more to help out its indebted neighbors, even as the country’s economy pushes it into a position of unrivaled power in Europe.

Germany is at a crossroads: become the Continent’s leader or be seen as the neighborhood bully. In a stroke of fortune, it is about to install, as its next president, a man known more for his integrity and moral leadership than for his political acumen, a man who can help make sure his country follows the first course.

Mr. Gauck’s election by the Federal Convention, made up of the lower house of the Parliament and representatives of the 16 German states, is a foregone conclusion, having been negotiated beforehand by the leading parties. The ceremonial nature of the vote underlines the impression that the president’s role is largely invisible.