The 61-year-old will represent the EU's top economy abroad in the largely ceremonial post and act as a kind of moral arbiter for the nation.
The 61-year-old, who regularly polls as Germany's most popular politician, will represent the EU's top economy abroad in the largely ceremonial post and act as a kind of moral arbiter for the nation.
His Social Democrats (SPD) hope the appointment will boost their fortunes just as their candidate Martin Schulz, the former European parliament president, readies to challenge Chancellor Angela Merkel in September elections.
Accepting the five-year post, Steinmeier said he would promote dialogue and democracy in the current "stormy times" when many citizens fear the world is "coming undone".
And he vowed to stand up to the rising trend of populism and "all those who think that in a world which is becoming more difficult, the solutions must become simpler".
"The answers will remain difficult, and I think the best answers can be found in democracy," he said, speaking to ARD television shortly after the vote.
Steinmeier received 931 of 1,239 valid votes after Merkel's conservatives, lacking a strong candidate of their own, agreed to back him to replace incumbent Joachim Gauck, 77, a former pastor from ex-communist East Germany.
The vote was held in Berlin's glass-domed Reichstag building by a special Federal Assembly, made up of national lawmakers and electors sent from Germany's 16 states -- among them deputies but also artists, writers, musicians and national football coach Joachim Loew.
With his snowy white hair, round glasses and dimpled smile, Steinmeier is one of Germany's best-known politicians, having twice served as top diplomat under Merkel for a total of seven years.
Though the trained lawyer is usually measured in his speech, in the thick of last year's US election campaign Steinmeier labelled Donald Trump a "hate preacher".
The Berliner Morgenpost newspaper judged that Steinmeier looks set to be "the anti-Trump president" when he assumes the post on March 19.
Steinmeier however lost his cool once, in 2014, when he yelled at Berlin protesters who had accused him of being a "warmonger" over his Ukraine policy.
The outburst was so unusual it became a minor YouTube hit.
A policy wonk by nature, Steinmeier served as adviser and then chief of staff to Merkel's predecessor, the SPD's Gerhard Schroeder.
In 2009, Steinmeier ran against Merkel and lost badly, only to return years later to her cabinet.
Political scientist Michael Broening of the SPD's think-tank the Friedrich Ebert Foundation said that "as foreign minister, Steinmeier often acted as a voice of reason, bridging gaps and bringing people together".
"It is hardly surprising that Steinmeier has branded himself as the essential anti-Trump," he added.
Steinmeier is well known in the world's capitals, but his appointment worries some in eastern Europe, who see him as too soft on Russian President Vladimir Putin.
He raised eyebrows with NATO partners last year when he criticised a military exercise in Poland as "sabre rattling".
The Kremlin was among the first to congratulate Steinmeier.
"The Russian head of state has expressed certainty that Mr Steinmeier's activities in this post will contribute to the development of Russian-German relations," it said in a statement.
And French Foreign Minister Jean-Marc Ayrault, a former German teacher, tweeted praise in both French and German.
Steinmeier has "all my confidence for his contribution to EU unity and the friendship between our two countries", Ayrault said.
Having Steinmeier move into the presidential Bellevue Castle in Berlin has emboldened the SPD.
After years in the shadow of Merkel, the Social Democrats are smelling blood as the chancellor faces deep divisions within her conservative camp, and the rise of the hard-right populist party Alternative for Germany (AfD) after opening borders to a million asylum-seekers since 2015.
Since Schulz took over the candidacy in late January, the SPD has risen sharply in the opinion polls.
It scored 32 percent -- its highest in a decade and only one point behind Merkel's conservatives -- in an Emnid poll for the Bild am Sonntag newspaper, which asked in a headline: "Is this the beginning of the end of the Merkel era?"
The SPD finally hopes to have a realistic shot at toppling Merkel.
"For Germany's Social Democrats, Steinmeier's election is a prelude to something bigger to come: a victory in September's elections against Merkel," said Broening.