Sweden's center-left opposition secured a narrow victory in the country's general election, according to final results released Thursday by the Swedish Election Authority.

The four parties in the left-leaning bloc captured 176 seats in the 349-seat Riksdag, while the four parties supporting outgoing Prime Minister Ulf Kristersson's conservative-led government took 173 seats. The margin amounted to a slim three-seat majority for the opposition.

Kristersson announced his resignation shortly after the tally concluded. In a statement posted on social media, he requested to be relieved of his duties to allow the speaker of parliament to begin the process of forming a new government.

Voters cast ballots on Sunday, but the race remained too close to call for days as officials counted late-arriving and overseas ballots. Only about 50,000 votes ultimately separated the two sides in a nation of roughly 10.6 million people.

The Social Democrats, led by former Prime Minister Magdalena Andersson, emerged as the largest single party with 99 seats, though the party lost some ground compared with the previous election. Andersson is now positioned to attempt a return to the premiership.

The left bloc includes the Social Democrats along with the Left Party, the Greens, and the Centre Party. Negotiations to form a government are expected to prove challenging due to policy differences among those partners, particularly on issues such as taxation and energy.

On the right, the Sweden Democrats saw their support decline, finishing with 62 seats. The party had been part of the governing arrangement but lost influence in the outcome.

The result reverses the right-wing bloc's hold on power that began after the 2022 election. Turnout reached approximately 85 percent.

The new parliament is scheduled to convene later this month, with the earliest possible swearing-in of a new prime minister set for September 29.