German politicians attended a church service in Berlin on Sunday, ahead of electing a new president.
Although the post is largely ceremonial, past German presidents have used the role to act as a moral authority in debates of national and global importance.
The social-democrat will on 18 March succeed President Joachim Gauck, who for health reasons did not stand for re-election.
German Chancellor Angela Merkel congratulated Steinmeier and said she was convinced he would be an excellent president who would have the support of the vast majority of the people.
He received 931 of the 1,260 votes.
His election coincided with a Social Democratic surge in polls since the center-left chose Martin Schulz, a former president of the European Parliament, to lead them into battle against Ms. Merkel in the elections.
Triple treat: Eclipse, comet, full moon all coming Friday night
A penumbral lunar eclipse occurs when the moon crosses the Earth's shadow, causing a slight dimming on the moon's lower half. The top part of the moon will show the brightest color, as it will only miss the Earth's full shadow by about 100 miles.
Reports on Saturday said Steinmeier, who previous year called Trump one of the world's "hate preachers", topped the list of favorites for the Sunday election.
Right-wing opposition leader Petr Fiala (Civic Democrats, ODS) said Steinmeier was an experienced politician and diplomat.
On Nov. 9, the day after Trump's election victory, Steinmeier openly expressed disappointment with the outcome.
During his campaign from previous year, Steinmeier was one of his toughest critics.
The election may still be more than seven months away, but the SPD finally hopes to have a realistic shot at toppling Dr Merkel. Steinmeier later became the country's vice chancellor for two years before being crushed by Merkel when he ran for chancellor in 2009. He will serve a five-year term in the largely ceremonial post.