An Indonesian woman held for two years on suspicion of killing North Korean leader Kim Jong-un's half-brother was freed from custody Monday after Malaysian prosecutors unexpectedly dropped the murder charge against her.

Siti Aisyah cried and hugged her Vietnamese co-defendant, Doan Thi Huong, before leaving the courtroom and being ushered away in an embassy car. She told reporters that she had only learned Monday morning that she would be freed.

"I feel very happy," she said later at a news conference at the Indonesian Embassy. "I didn't expect that today will be my freedom day."

She flew back to Jakarta, Indonesia's capital, later Monday and thanked the president and other officials for their help.

The two young women were accused of smearing VX nerve agent on Kim Jong-nam's face in an airport terminal in Kuala Lumpur on Feb. 13, 2017. They have said they thought they were taking part in a prank for a TV show. They had been the only suspects in custody after four North Korean suspects fled the country the same morning Kim was killed.

Discharged without acquittal

The High Court judge discharged Aisyah without an acquittal after prosecutors applied to drop the murder charge against her. They did not give any reason.

The trial will resume Thursday, with prosecutors expected to reply to a request by Huong's lawyers asking the government to similarly withdraw the charges against her.

Siti Aisyah smiles while leaving court outside Kuala Lumpur, Malaysia, on Monday after a prosecutor withdrew a murder charge against her. (Mohd Rasfan/AFP/Getty Images)

Indonesia's government said its continual high-level lobbying resulted in Aisyah's release. The foreign ministry said in a statement that she was "deceived and did not realize at all that she was being manipulated by North Korean intelligence."

It said Aisyah, a migrant worker, believed that she was part of a reality TV show and never had any intention of killing Kim.

Indonesia pushed for release

The ministry said that over the past two years, Aisyah's plight was raised in "every bilateral Indonesia-Malaysia meeting," including at the president's level, the vice-president's level and in regular meetings of the foreign minister and other ministers with their Malaysian counterparts.

Aisyah's release comes just a month before Indonesia's general election and is seen as a boost to President Joko Widodo, who is seeking re-election.

Doan Thi Huong is escorted by Malaysian police from court on Monday. A High Court judge last August had found there was enough evidence to infer Aisyah, Huong and four missing North Koreans had engaged in a "well-planned conspiracy" to kill Kim Jong-nam. (Mohd Rasfan/AFP/Getty Images)

Aisyah thanked Widodo and his government for helping secure her release. Officials said she was expected to fly back to Jakarta, Indonesia's capital, later Monday.

Wearing a red headscarf and a black flowery traditional dress, Aisyah was composed during the news conference. She said that she was well-treated in prison and received plenty of encouragement, but that she was eager to meet her family again.

'I am in shock'

Prosecutor Iskandar Ahmad said that the discharge not amounting to acquittal means Aisyah can be recharged if there is fresh evidence, but that there are no such plans for now.

Meanwhile, Huong said she was shocked by the development.

"I am in shock. My mind is blank," a distraught Huong told reporters through a translator after Aisyah left.

Huong's lawyer Hisyam Teh Poh Teik said Huong felt Aisyah's discharge was unfair to her as the judge last year had found sufficient evidence to continue the murder trial against them.

"She is entitled to the same kind of consideration as Aisyah," he said. "We are making representation to the attorney general for Doan to be taken equally ... there must be justice."

Could have been seen as threat

A High Court judge last August had found there was enough evidence to infer Aisyah, Huong and the four missing North Koreans had engaged in a "well-planned conspiracy" to kill Kim Jong-nam. The defence phase of the trial had been scheduled to start in January but was delayed until Monday.

Lawyers for the women have previously said that they were pawns in a political assassination with clear links to the North Korean Embassy in Kuala Lumpur, and that the prosecution failed to show the women had any intention to kill. Intent to kill is crucial to a murder charge under Malaysian law.

Malaysian officials have never officially accused North Korea and have made it clear they don't want the trial politicized.

Kim was the eldest son in the current generation of North Korea's ruling family. He had been living abroad for years but could have been seen as a threat to Kim Jong-un's rule.