Story highlights Steinmeier received 931 out of 1,253 votes

He has called President Donald Trump a "hate preacher"

(CNN) Germany's parliamentary assembly has elected Frank-Walter Steinmeier, a Social Democrat, as the country's president.

The position of president in Germany is largely ceremonial, because the chancellor is the official head of government and has a higher profile on the world stage.

Steinmeier previously served as vice chancellor and foreign minister under current Chancellor Angela Merkel.

He was elected by the vast majority of the assembly, receiving 931 out of 1,253 votes. His predecessor, Joachim Gauck, did not seek another term and will step down on March 18.

"This country for many in the world has become an anchor of hope," Steinmeier said after his election. "We give others courage, not because everything is good, but because we have shown that it can be better," he said.

Read More