Park Geun-hye
Anti-Park activists react after the South Korean parliament's successful impeachment of President Park Geun-Hye, as huge crowds gathered outside the National Assembly in Seoul Ed Jones/ AFP

A huge majority in South Korea's parliament have voted to impeach embattled president Park Geun-hye but whether or not she loses her post will depend on nine judges in the country's constitutional court. They have up to 180 days to decide whether the vote, which Park lost by 234 votes to 56, was valid and the scandal-wracked leader has to stand down.

Similarly to Britain – where high court judges will decide on whether the government can take the country out of the EU after the Brexit vote – the fact that Park could potentially be saved by judges rather than by politicians has caused controversy in South Korea.

Democratic Party of Korea lawmaker Moo Jae-in, one of Park's main critics, has warned constitutional court judges – all of which were appointed by Park and her conservative predecessor – that to overturn the impeachment decision would be a betrayal of the South Korean people.

The scandal is centred around Choi Soon-sil, Park's friend of 40 years, who is accused of using her influence over the president to amass a fortune in donations to her two non-profit foundations. She is also accused of using her influence to help her daughter get into university.

Korean media have reported that Park sought Choi's advice on everything from political appointments to what colours she should not wear (red and white). Park had admitted that Choi had helped her with public relations and even edited some of her speeches.

But the impeachment stems from the fact that Choi was in possession of classified documents dealing with foreign policy and the internal workings of government on an old hard drive.

Much of the international attention to the scandal has focused on Choi's adherence to Korean shamanism, known as Muism or Sinism. Choi's father, Choi Tae-min, was a cult leader who became an adviser to Park's father, military dictator Park Chung-hee, who was assassinated in 1979.

Choi became close to Park Geun-hye after her mother's death in 1974, reportedly telling her that her late mother had appeared to him in a dream. His influence on her was so great that WikiLeaks cables revealed in 2007 referred to him as the "Korean Rasputin" after Grigori Rasputin, the Russian faith healer and peasant who became one of Tsar Nicholas II's chief advisors.

After the cult leader's death in 1994, his daughter, Choi Soon-sil, became leader of the Church of Eternal Life. She had been close to Park since her father's assassination but had largely been out of the public eye, acting as her advisor and, Korean media claims, her spiritual guide.

In October, thousands of South Koreans took to the streets to call for Park to stand down over allegations she let Choi interfere in government affairs. They held candles calling for her to stand down after she admitted on live television that Choi had edited the president's speeches. The authorities later carried out raids on the homes and officials of officials linked to Park as well as Choi's two charitable funds.

The two candidates vying to replace Park should she stand down are Moo Jae-in, who is leading the polls and stood against Park in the presidential elections of 2012, and former UN secretary general Ban Ki-Moon, the 72-year old former foreign minister.