BERLIN (AP) — A German parliamentary assembly will elect the country's new president on Sunday, with a respected former foreign minister who last year called Donald Trump one of the world's "hate preachers" the overwhelming favorite to win.

The German president has little executive power, but is considered an important moral authority. The new head of state will succeed Joachim Gauck, a 77-year-old former pastor and East German pro-democracy activist, who announced last year that he wouldn't seek a second five-year term because of his age.

The president is elected by a special 1,260-member assembly made up of the 630 lawmakers in parliament's lower house and an equal number of representatives from Germany's 16 states.

Frank-Walter Steinmeier, Germany's foreign minister until last month, has the support of Chancellor Angela Merkel's "grand coalition" of center-right and center-left parties. Between them, Merkel's conservative Union bloc and the center-left Social Democrats — her junior coalition partners — hold 923 seats, which should assure Steinmeier's election.

Steinmeier, a Social Democrat, emerged as the government's candidate after Merkel was unable to find a conservative of presidential stature willing to run for the job. He has long been one of Germany's most popular politicians, although he failed in a long-shot bid to unseat Merkel as chancellor in 2009.

The presidential vote is likely to be one of the last moments of coalition unity ahead of a parliamentary election in September in which Merkel is seeking a fourth term. Both sides hope to end the "grand coalition."

The Social Democrats are currently enjoying a poll boost from their surprise nomination as her challenger of Martin Schulz, a former European Parliament president.

Unlike Gauck, who has no party affiliation, Steinmeier has had a long career in German politics. As former Chancellor Gerhard Schroeder's chief of staff, he was one of the main architects of Schroeder's 2003 package of economic reforms and welfare cuts, which has been credited with making the German economy more robust.

Under Merkel, he served twice as foreign minister — from 2005 to 2009 and again from 2013 until this year, with a stint as opposition leader in between. He has won respect for his persistence in trying to resolve the long-running crisis in Ukraine.

Steinmeier, 61, is normally studiously diplomatic, but strongly criticized Trump during the U.S. election campaign.

Asked in August about the rise of right-wing populism in Germany and elsewhere, Steinmeier criticized those who "make politics with fear." He cited the nationalist Alternative for Germany party, the promoters of Britain's exit from the European Union, and "the hate preachers, like Donald Trump at the moment in the United States."

When he was nominated for the presidency in mid-November, Steinmeier called for confidence in the face of international crises. A German president "must not be someone who simplifies things; he must encourage people," he said.

"The events of our times — Brexit and its consequences for Europe, the election in the U.S., the situation in Turkey — are truly political earthquakes," he said. "They shake us, but they can also shake us awake."

There are four other candidates in Sunday's election.

The opposition Left Party nominated Christoph Butterwegge, a political science professor who opposed Schroeder's economic reforms. A deputy leader of Alternative for Germany, Albrecht Glaser, also is running, as is Alexander Hold, nominated by the small Free Voters party in Bavaria, and Engelbert Sonneborn, the father of a satirist.