Swedish Prime Minister Ulf Kristersson resigned on Thursday after his right-leaning coalition lost a narrow parliamentary majority in Sunday's general election.

The Swedish Election Authority completed its preliminary count, giving the center-left opposition bloc 176 seats in the 349-seat Riksdag compared to 173 for Kristersson's Tidö government and its supporting parties. The two sides were separated by roughly 50,400 votes in a country of about 10.6 million people.

Kristersson, leader of the Moderate Party, posted his resignation letter on X shortly after the results became clear. He requested immediate dismissal to allow the parliamentary speaker to begin the process of forming a new government.

The left-leaning bloc, led by former Prime Minister Magdalena Andersson of the Social Democrats, won the most seats. Andersson addressed supporters in a victory speech, stating that voters had chosen a new direction focused on unity.

Kristersson's government had relied on support from the anti-immigration Sweden Democrats. That party saw its support drop, losing 11 seats and falling to third place overall.

Negotiations for a new government are expected to take weeks. The earliest a new prime minister could be approved is September 29. Andersson must secure agreements among parties with differing priorities on issues such as taxes and immigration.

The right-leaning bloc had campaigned on continuing its policy direction, including tougher measures on crime and migration. The close result highlights the divided political landscape in Sweden.