Alamy A Vietnamese prisoner used syringes and another inmate's semen to impregnate herself. The country's penal code prohibits executing pregnant prisoners.

When a Vietnamese drug smuggler gives birth this spring, she can thank her newborn baby for saving her life.

Nguyen Thi Hue, 42, was arrested in the coastal province of Quang Ninh in 2012 on charges of drug trafficking, local newspaper Thanh Nien News reports. She was sentenced to death two years later. When she appealed, the court upheld her sentence, according to the Associated Press.

But it looks like Hue will avoid the death penalty after all. The Vietnamese penal code forbids the execution of pregnant women or mothers with children under the age of 36 months and orders that in those cases the death penalty should be converted to life imprisonment.

Investigators discovered that Hue paid a 27-year-old male inmate more than $2,000 in August 2015 for his semen and syringes, which they say she used to inseminate herself. The baby is due in April, and Hue's sentence will officially be reduced to life imprisonment after the birth.

Four officers at the prison have been suspended for alleged negligence, the Associated Press reports.

As Thanh Nien News points out, this is not the first time a prisoner has pulled off escaping death row by getting pregnant.

In 2007, two guards who worked at Hoa Binh prison were jailed after they allowed a male inmate to have sex with a female prisoner, which resulted in a pregnancy. The prisoner gave birth to a boy in March of that year and escaped death by firing squad.

Vietnam has come under international pressure in the past decade to end the death penalty, and wrongful convictions have drawn harsh scrutiny.

“Wrongful verdicts, threats and torture are critical threats to the system itself. The [victims'] descendants will hold us accountable,” Truong Trong Nghia, vice chairman of the Vietnam Bar Association, said in late 2014.

Foreign governments and human rights groups have spoken out against Vietnam's use of the death penalty as well, especially for drug-related offenses. Australia fiercely protested when a Vietnamese court upheld the death sentence for one of its citizens, Le My Linh, who was convicted of drug trafficking in 2002. "Australia is universally and consistently opposed to capital punishment," former Minister for Foreign Affairs Alexander Downer said in a statement at the time.

Vietnam passed a revision of its penal code last year, which will come into effect in July 2016. Capital punishment will be abolished for seven crimes, including: robbery, production and trade of fake food, drug possession, drug appropriation, destruction of projects of national security importance, opposing order and surrendering to the enemy. Officials charged with corruption who pay back 75 percent of the illegal money they make will also have their death sentences lessened to life imprisonment under Vietnam's revised law.

Also on HuffPost:

PHOTO GALLERY No Seconds: The Last Meals Of Death Row Prisoners