Sweden’s Prime Minister Stefan Lofven of the Social Democrats party said unexpectedly on Sunday he would resign later this year ahead of general elections in September 2022, Reuters reported.

“I have informed the party’s executive committee and the nomination committee’s chairman that I want to leave the role as party leader at the party congress in November and thereafter also retire as prime minister,” Lofven said in an annual summer speech.

Lofven, who has been prime minister since 2014, resigned in June after losing a no-confidence, vote but got re-elected by parliament in July.

“In next year’s election campaign the Social Democrats will be led by someone else than me,” he said. “Everything has an end, and I want to give my successor the very best conditions.”