Denmark's center-right prime minister has resigned after a general election that ended with a gain for left-leaning parties and a big loss for populists who were supporting the government.

Prime Minister Lars Loekke Rasmussen's resignation Thursday leaves the center-left Social Democrats to try to form a one-party minority government.

Mette Frederiksen, the leader of Denmark's largest party, will start complex talks to reach a basis for a government.

Frederiksen had rejected forming a coalition with Loekke Rasmussen's Liberals.

Loekke Rasmussen failed to maintain a majority in parliament after the populist Danish People's Party's vote share plunged to 8.7% in Wednesday's election from 21.1% in 2015.