A rape victim is set to be jailed for 20 years for attempted murder after she gave birth to her abuser’s baby in a toilet in El Salvador.

Imelda Cortez has been in custody since April 2017 after giving birth to a baby girl who had been fathered by her abusive elderly stepfather.

The then-teenage Cortez was rushed to hospital after her mother discovered her in severe pain and bleeding heavily.

The emergency room doctor suspected Cortez had attempted an abortion and called the police.

MORE: PHOTO: The sad story of Julius! A victim, of Madina-Adenta carnage

The baby was found healthy and alive in the toilet, reports the Guardian.

Cortez had been abused by her 70-year-old stepfather since she was 12 and said she had no idea she was pregnant.

Jacob Rees-Moggs stuns radio listeners after claiming women should not have an abortion even after rape

Bertha Maria Deleon, one of her defence lawyers, told the Guardian: “This is the most extreme, scandalous injustice against a woman I’ve ever seen.

“The state has repeatedly violated Imelda’s rights as a victim.  She’s deeply affected but denied psychological attention. “Abortion is illegal in all circumstances in El Salvador.

According to the Guardian while Cortez was in hospital, her stepfather visited her, threatening to kill her, her siblings and her mother if she reported the abuse. Another patient overheard and told a nurse, who called the police.

Prosecutors initially accused Cortez of inventing the abuse to justify her crime however a DNA test confirmed the baby’s paternity. Her stepfather is yet to be charged.

The criminal trial against Cortez starts today, with a ruling by the three judges expected within a week.