The German parliament has elected former foreign minister Frank-Walter Steinmeier to the largely ceremonial post of president.

Steinmeier had the support of Chancellor Angela Merkel. He is a critic of United States President Donald Trump.