Former U.N. secretary general Ban Ki-moon said Wednesday that he would not run for president of South Korea, a surprise announcement after weeks of laying political groundwork but then watching his plans erode over what he dubbed “fake news.”

His decision leaves South Korea’s conservatives without an obvious successor to Park Geun-hye, the beleaguered incumbent, and gives progressives an unexpected boost.

Upon his return last month, Ban, a 72-year-old career bureaucrat, quickly found himself being buffeted around in South Korea’s famously tumultuous political sphere. He was mocked on the Internet for being out-of-touch with his home society after a decade in New York, and corruption allegations were leveled at members of his family, dimming much of his star power.

Ban called the attacks part of a “fake news” campaign to discredit him and his family.

“For the past three weeks, I have devoted everything I had, but my genuine patriotism and passion were damaged by rumors and fake news,” Ban said Wednesday at a hastily arranged news conference at the National Assembly after meeting with the leaders of three political parties. “I, my family and the U.N. have been greatly hurt. . . . I will give up my pure aspiration to achieve a change in politics under my leadership and unify the country.”

Ban joins other former U.N. chiefs who turned their backs on the world of elected politics. Boutros Boutros-Ghali did not heed calls from supporters to run in his native Egypt, and Ghana’s Kofi Annan also decided against a bid for president in the West African country and opted to create a humanitarian foundation.

Ban’s approval ratings had been steadily falling since his return to South Korea, and to a hero’s welcome, in early January. The latest polls showed him running at 13 percent, 20 points behind Moon Jae-in, the progressive front-runner.

Moon, a former leader of the Democratic Party who favors engagement with North Korea and is skeptical about an American antimissile battery, said he was he was “caught off guard” by Ban’s decision. “I was looking forward to a good competition,” he told reporters.

With Ban’s announcement, the progressive faction’s prospects just improved sharply, said Kim Yun-cheol of Kyung Hee University. “Now it seems there is a higher possibility of a change in administration in the upcoming election with Ban dropping out of the race,” he said.

And all of this happened just one day before Jim Mattis, the new U.S. defense secretary, is due to arrive in Seoul, with the deployment of the controversial Terminal High Altitude Area Defense system, or THAAD, at the top of the agenda.

The announcement came as a shock to South Koreans because Ban had been going through all the motions of preparing to run. He had been visiting former presidents, kissing babies, bowing at graves and meeting political leaders. It was considered a matter of when, not if, he would announce his candidacy for the presidential election, whenever it is held.

Elections were set to be held in December, at the end of Park’s five-year term, but she is now facing impeachment over her role in a corruption and influence-peddling scandal. The Constitutional Court is weighing whether to uphold a National Assembly motion to impeach Park, with a decision possible later this month.

If Park is impeached, the next presidential election must be held within 60 days of the court’s decision. If she is exonerated, the election will be held in December as originally scheduled.

Before the corruption scandal revolving around Park broke in October, Ban’s prospects for winning the presidency appeared good. But he has been hurt by his closeness to Park — the two had repeated meetings last year, which were viewed here as a sign that they were hatching a handover plan — and by allegations of corruption against those close to him.

The United States has indicted Ban’s younger brother and his nephew on charges of bribery related to the sale of a high-rise building in Vietnam. The nephew has been indicted in New York, and the United States is asking South Korea to extradite the brother. Ban denies any knowledge of such a scheme.

Separately, there have been rumors that Ban received bribes while he was foreign minister, which Ban vehemently denies.

But even the whiff of corruption at a time like this was fatal, said Kang Won-taek, a political scientist at Seoul National University. The country has been gripped by the corruption scandal centering on the president and her confidante, but it has also dragged in a slew of business and political leaders.

“There have been mass protests against the establishment, but Ban belongs to the conservative establishment, so he had inherent difficulties and failed to gain support,” Kang said.

That Ban had no political experience and no political support base was another handicap, he said. “From the beginning, he had trouble adapting to this new environment,” Kang said.

Indeed, Ban seemed to attribute his decision to the mudslinging political scene. “I have found political players very selfish and to be stuck in the past,” he said at the news conference. “I have come to the conclusion that it is meaningless for me to continue my path with them.”

A spokesman for the Bareun, or Righteous party, formed out of the president’s conservative party amid the scandal and had been actively trying to recruit Ban, expressed “astonishment.”

Yoonjung Seo in Seoul contributed to this report.