Ulf Kristersson, the leader of the conservative Moderate Party, was elected on Monday as Sweden's prime minister with the support — for the first time — of the anti-immigration Sweden Democrats.
The 58-year-old politician announced last week that his party, along with the Christian Democrats and Liberals, had reached a deal to form a minority coalition backed by the Sweden Democrats.
On Monday, 176 lawmakers voted in favor of Kristersson becoming the next prime minister, and 173 voted against.
Kristersson will replace outgoing Prime Minister Magdalena Andersson of the Social Democrats.
Andersson's center-left party dominated Swedish politics since the 1930s but is now in opposition after the September election.
What is expected from the new Swedish government?
The three parties in the next right-wing government and their key ally, the far-right Sweden Democrats, have presented a road map for their government.
The 62-page document calls for increased police funding and the construction of new nuclear reactors.
The new government is likely to make major cuts to the country's refugee and immigration policies, including restricting immigration laws, toughening rules on immigrants receiving benefits from the state and reviewing inducements for voluntary repatriation "with a particular focus on those who have not integrated."
Kristersson is also widely expected to back Sweden's historic bid to join NATO.
He said the coalition government will remain in "close collaboration" with the Sweden Democrats.
The Sweden Democrats said they would have preferred to technically be part of the minority coalition but stressed that the policies the government pursued were what ultimately mattered to them.
"It is what the government does that is important, not what the government looks like," Sweden Democrat leader Jimmie Akesson told parliament.