Danish PM resigns after center-right wins vote after gains by anti-immigration party

Anders Samuelsen, left, head of the Liberal Alliance, Lars Loekke Rasmussen, second left, head of the Liberal Party, Kristian Thulesen Dahl, second center, head of the Danish People's Party and Helle Thorning-Schmidt, right, head of the Social Democrats, arrive for a live televised debate after the result of the election became clear early Friday morning, June 19. 2015 in the Parliament at Christiansborg Castle in Copenhagen. Denmark's center-right opposition won a parliamentary election after strong gains by an anti-immigration party that wants to limit the European Union's influence over the small Nordic country. Thorning-Schmidt announced her resignation as prime minister and the leader of the party. (Casper Dalhoff/Polfoto via AP) DENMARK OUT (The Associated Press)

Lars Loekke Rasmussen, left, head of the Liberal Party, and his wife, Sólrun, wave after the result of the election became clear early Friday morning, June 19. 2015 at the Parliament in Christiansborg Castle in Copenhagen. Denmark's center-right opposition won a parliamentary election after strong gains by an anti-immigration party that wants to limit the European Union's influence over the small Nordic country. With all votes counted, preliminary official results showed the opposition bloc led by Loekke Rasmussen, a former prime minister, would get the 90 seats needed to secure a majority in the 179-seat legislature. (Casper Dalhoff/Polfoto via AP) DENMARK OUT (The Associated Press)

Denmark's center-left prime minister has resigned, paving the way for the Liberal leader to start tough talks on forming a Cabinet following the success of an anti-immigration party that lifted the center-right opposition to victory.

Helle Thorning-Schmidt, who also is quitting as Social Democratic leader, presented her resignation to Queen Margrethe at the royal palace on Friday.

The Danish People's Party that wants to limit the European Union's influence over the Scandinavian country, made large gains in Thursday's elections and overtook Lars Loekke Rasmussen's Liberal Party as Denmark's second largest party.

The bloc led by Loekke Rasmussen, a former prime minister, secured the 90 seats necessary for a majority in Parliament. To form a government, he needs to include the Danish People's Party in talks expected to start later Friday.