A Malaysian court on Monday sentenced a Vietnamese defendant accused of murdering Kim Jong Nam, the estranged half-brother of North Korea's leader, to 40 months in prison after she pleaded guilty to a lesser charge.

Earlier in the day, prosecutors offered the defendant, Doan Thi Huong, 30, the new charge of causing hurt with a dangerous substance, which is punishable by up to 10 years in prison, not death as the initial murder charge mandated.

Given that Huong has been detained for over two years and shown good behavior, she is entitled to a one-third reduction in her prison term and could be freed as early as the first week of May, her lead defense counsel Hisyam Teh Poh Teik told reporters.

The new development comes three weeks after prosecutors unexpectedly withdrew the murder charge against Huong's co-accused, Indonesian woman Siti Aisyah, 27, enabling her to immediately return home to Indonesia afterward.

The women had been accused of killing North Korean leader Kim Jong Un's paternal half-brother by smearing the highly toxic nerve agent VX on his face at Kuala Lumpur International Airport on Feb. 13, 2017.

The brazen attack captured international attention with surveillance camera footage appearing to show the two women poisoning Kim Jong Nam, who was at the airport to fly out of Malaysia, and with a group of North Koreans believed to be behind the plot but never arrested or brought to trial.

Following the Indonesian woman's release on March 11, the Vietnamese government pushed the Malaysian government to do the same for its citizen, with her defense lawyers requesting she immediately be freed.

Prosecutors gave no reasons as to why they were offering Huong the lesser charge on Monday.

Shah Alam High Court judge Azmi Ariffin said he took it into consideration that she had immediately pleaded guilty to the new charge and she was a first-time offender without a previous criminal record.

"First of all, Ms. Doan, I must say that you are a very, very lucky person indeed," Azmi said during the sentencing. "I honestly think you should be grateful to the attorney general and the public prosecutor for offering you the alternative charge.

From the dock in the courtroom, Huong said, "Thank you, judge, public prosecutors, the attorney general, the Vietnamese embassy."

The judge responded by saying, "Soon you will be going back to be with your family."

As the judge read out her 40-month sentence running from the time of her arrest, Huong's father Doan Van Thanh and Vietnamese embassy officials in the public gallery broke into applause and cheered.

Huong's lead counsel, Hisyam, said the defense had proposed the charge against her to be reduced to one of "causing death by negligence" with a maximum two-year prison term, but that the attorney general made a counteroffer with "voluntarily causing hurt by dangerous weapons or means" that carries up to 10 years in prison, a fine or whipping.

The two women were arrested within days of the attack on Kim Jong Nam. In their trial, which began in October 2017, the women pleaded not guilty, with the defense claiming that they thought they were taking part in a TV-related prank and that they were both made "scapegoats" by North Koreans.

Prosecutors alleged that the women had a "common intention" with four North Koreans to murder Kim Jong Nam, but the four -- Ri Ji Hyon, Ri Jae Nam, Hong Song Hac and O Jong Gil -- fled Malaysia within hours of the incident and are believed to have returned to North Korea.

In August last year, the judge determined that the prosecution had established a prima facie case against the women based on the testimony of 34 witnesses and airport security camera footage, and ordered them to mount a defense against what he said was a "well-planned conspiracy" hatched with the four North Korean suspects.

Huong's father appeared for his daughter's trial for the first time on Monday. He said he misses his daughter and cannot wait for her to return.

Vietnamese Ambassador to Malaysia Le Quy Quyn insisted on Huong's innocence.

"I want to emphasize that she is a victim like the Indonesian citizen Siti Aisyah," he said.

Visibly jubilant at Monday's outcome, Hisyam described it as a "happy ending" to a two-year-plus ordeal for his client. However, he tempered it with a warning that justice has not been served as far as the murder victim, Kim Jong Nam, is concerned.

"Until the four North Koreans are brought to justice, we can't say that justice has been served," he told reporters.