SEOUL, South Korea -- South Korean President Park Geun-hye said Tuesday that she will resign her office once parliament develops a plan for a safe transfer of power. The surprise announcement, which the opposition called a ploy to delay impeachment, comes amid prosecution claims that she colluded with a friend who wielded government power from the shadows.

Hundreds of thousands of people have rallied in Seoul each Saturday for the last five weeks to demand that Park step down.

Park would be the first South Korean leader to resign since the country’s first president, Syngman Rhee, quit and then fled to Hawaii amid a popular uprising in 1960. The succeeding government was overthrown by a coup by Park’s late father, the military dictator Park Chung-hee, whose rule also abruptly ended after he was assassinated by his spy chief in 1979.

Protesters march with candles at a protest calling South Korean President Park Geun-hye to step down in Seoul, South Korea on Nov. 26, 2016. REUTERS

“I will leave the matters about my fate, including the shortening of my presidential term, to be decided by the National Assembly,” Park said Tuesday in a live address to the nation, referring to parliament. “If the ruling and opposition parties discuss and come up with a plan to reduce the confusion in state affairs and ensure a safe transfer of governments, I will resign from the presidential position under that schedule and by processes stated in law.”

Get Breaking News Delivered to Your Inbox

Opposition parties had been closing in on an impeachment motion against Park, and even her allies in the conservative ruling party have called for her to “honorably” step down rather than face impeachment.

An impeachment motion vote has been planned for Friday. The country’s two largest opposition parties were also planning on Tuesday to nominate a special prosecutor to independently investigate the scandal.

The country’s largest opposition party, the Minjoo Party, called Park’s address Tuesday a ploy to avoid an impeachment vote and said the party would continue to push for impeachment as planned.

Choi Soon-sil, a long-time friend of the South Korean President Park Geun-hye, leaves after attending an investigation to determine an arrest warrant’s validity at a court in Seoul, South Korea, November 3, 2016. REUTERS

At the heart of the scandal is Choi Soon-sil, Park’s longtime friend and the daughter of a late cult leader who allegedly meddled in state affairs and pressured companies to donate millions of dollars to foundations controlled by her at the request of Park.

Prosecutors have so far indicted Choi, two ex-presidential officials and a music video director known as a Choi associate for extortion, leakage of confidential documents and other charges.

Park, who has immunity from prosecution while in office, has refused to meet with prosecutors. Her lawyer, Yoo Yeong-ha, has described prosecutors’ accusations against Park as groundless.