Poland's parliament has backed Donald Tusk to become prime minister after incumbent Mateusz Morawiecki lost a key vote in the country's parliament on Monday.
Morawiecki's populist Law and Justice (PiS) party failed to win a majority in the October elections.
President Andrzej Duda, a PiS ally, nevertheless appointed Morawiecki to lead the government.
His failure to win a vote of confidence paves the way for Tusk to become prime minister.
In total, 190 MPs voted for Morawiecki's government, compared to 266 against. The Sejm, the country's parliament, then appointed Tusk to lead the country.
He is expected to take office this week.
The October election saw a coalition led by Tusk win a majority of seats with a record turnout of more than 70%.
The group consists of three parties, Tusk's Civic Coalition (KO), Third Street and Left.
Morawiecki's ruling PiS emerged as the single largest party after the election, but other parties refused to work alongside it and was unable to form a majority in parliament.
Duda's decision to appoint Morawiecki to lead the country meant that the formation of the new government was delayed for several weeks.