Members of South Korea’s main opposition Minjoo Party watch a news report on the results of exit polls in Seoul on April 13, 2016. (Kim Hong-Ji/Reuters)

South Korea’s ruling party suffered a shocking defeat in a general election held Wednesday, losing its majority in the National Assembly and delivering a heavy blow to its hopes in next year’s presidential poll.

The stunning upset caused the Saenuri Party’s leader to resign the post Thursday morning and will make it almost impossible for President Park Geun-hye to advance her legislative agenda.

“People rendered their judgment on the party with a harsh stick and we were crushingly defeated,” Kim Moo-sung, the Saenuri Party leader and a presidential hopeful, said Thursday morning, adding that he would take responsibility for the “resounding defeat.”

Ahead of the election, many analysts predicted that the conservative Saenuri Party would increase its majority, with some even saying that it could win a super-majority of 180 seats in the 300-seat legislature. They thought that divisions within the center-left would split the opposition vote.

Instead, the Saenuri won just 122 seats while the main opposition Minjoo Party, which was previously called the New Politics Alliance for Democracy but changed its name before the election to try to create a new image, secured 123 seats, according to the National Election Commission.

Officials from the South Korean Central Election Management Committee count votes cast at the Yuido High School in Seoul, South Korea. (Chung Sung-Jun/Getty Images)

In perhaps the biggest surprise, the People’s Party, which broke off from the Minjoo Party, won 38 seats and achieved its goal of shaking up the two-party system. Analysts said ahead of the election that if the People’s Party could win 30 seats, it would become a significant negotiating bloc in the assembly.

The People’s Party is led by Ahn Cheol-soo, a maverick software developer with presidential ambitions, who also won his bid for a seat in the Nowon district of Seoul. Ahn garnered a strong following among young voters when he ran for the presidency in 2012, and he appeared to be gathering support from young conservatives this time around.

Voter turnout was 58 percent, the election commission said, up almost four points from 2012.

The results mark the first time in 16 years that a governing party has failed to keep a majority and will hasten the arrival of the “lame duck” period for Park.

Limited to a single five-year term, South Korean presidents traditionally have trouble getting anything done in their final year. Park’s term expires in early 2018, and South Koreans will go to the polls to elect a new president at the end of next year.

Although North Korea has been threatening to attack the South and has been firing missiles on a regular basis, the North was not the major issue of this election. The weak economy has been voters’ top concern.

Economic growth was 2.6 percent last year — lackluster by South Korean standards — and the International Monetary Fund recently downgraded its estimate of the country’s growth for this year to 2.7 percent.

Kim Chong-in, center, interim leader of the main opposition Minjoo Party of Korea, marks a winning candidate for the parliamentary election in Seoul, South Korea Wednesday. (Stringer/Reuters)

Unemployment has been rising, with the jobless rate among young people hitting 12.5 percent in February, the worst since the tracking of the data began almost 20 years ago. The economic downturn in China, a major importer of South Korean goods, has played a large role.

Park had vowed to revive the economy and to create more jobs, but her efforts to reform the labor market have been controversial, especially her plan to make it easier to lay off workers, and South Koreans complain that the economy is still in bad shape.

Read more: