El Salvador’s controversial law banning abortion in all circumstances, which has provoked ruthless miscarriages of justice, could be overturned in what has been described as a historic move.

Momentum is building around a parliamentary bill proposing to allow abortion in cases of rape or human trafficking; when the foetus in unviable; or to protect the pregnant woman’s health or life.

Prominent church groups, doctors, lawyers and ethicists have generated a groundswell of public support after speaking out in favour of loosening restrictions in a series of public hearings and debates.

It is the first time the deeply religious Central American country has openly debated abortion, forcing even conservative media organisations to cover the issue in editorials and primetime news programmes.

“This is a historic moment. There’s been a qualitative shift – it’s not just women’s groups speaking out. Abortion has become a priority topic for diverse groups. It smells and feels like change. Politicians must make amends for the damage done to thousands of women … there is no going back,” said Sara García, a campaigner with the Citizens’ Group for the Decriminalisation of Abortion.

Abortion was criminalised in El Salvador 20 years ago.

In 1997, legislators from across the political spectrum voted to strip women of their reproductive rights without any public debate or medical consultation about the consequences, after a shadowy campaign by a small group of powerful anti-choice groups linked to the Catholic church.

A handful of women’s rights activists who tried to persuade politicians to oppose the ban were silenced, literally, when microphones were switched off mid-speech.

The impact has been catastrophic.

Thousands of women and girls have suffered physical and psychological damage as a result of being forced to continue with pregnancies that were unviable, dangerous, or the result of rape.

Pregnant women with cancer have died after being denied chemotherapy to protect the foetus; women with ectopic pregnancies have been forced to wait until their fallopian tubes burst before doctors could intervene.

Others have risked their lives and freedom with unsafe back-alley abortions.

In addition, El Salvador – one of five countries where abortion is illegal in all circumstances – has imprisoned dozens of young women for murder after they suffered obstetric complications.

One such woman is María Teresa Rivera, 34, who was released from prison last year after serving four and a half years of a 40-year sentence for murder after suffering a miscarriage.

After she was exonerated, prosecutors continued to hound her through the courts, forcing Rivera – who feared a return to jail – to flee the country with her 11-year-old son. Both were granted asylum in Sweden this week.

The proposed law change would go a long way to ensuring that the lives and health of Salvadoran women are protected in line with international standards.

The bill was tabled last summer by the vice-president of the legislative assembly from the ruling Farabundo Martí National Liberation Front. It is the first time the ostensibly left-wing party has taken steps to overturn the total ban.

Last month, the committee on legislation and constitutional points, where the bill is being considered by nine cross-party deputies, convened the first public hearing on abortion.

A dozen of the 17 organisations and individuals who testified spoke in favour of loosening the ban.

The case of Beatriz, a 22-year-old woman with the autoimmune disease lupus who was denied an abortion in 2013, was presented by the Citizens’ Group.

The law should protect women’s lives and prevent avoidable harm, not just consider the unborn foetus or embryo Dr Guillermo Ortiz, Ipas

Beatriz’s health waned as she was forced to continue with the pregnancy for several months even though the foetus was unviable, after the supreme court ruled against allowing an abortion.

Dr Guillermo Ortiz, senior adviser for the health NGO Ipas and former chief of obstetrics at the largest maternity hospital in El Salvador, told the commission that patients had died and suffered harm after being denied treatment to comply with the abortion law.

“As health providers we need to work with the protection of the law, not against the law,” Ortiz told the Guardian.

“The law should protect women’s lives and prevent avoidable harm, and not just consider the unborn foetus or embryo. It’s about health, not just rights.”

Public support from respected medical professionals and the Anglican church for loosening the ban has helped move the issue into the mainstream, after years of entrenched argument between feminist activists and anti-choice groups.

“In this case the Anglican bishops consider that the only people who have the right to decide are the women who are pregnant,” Martín Barahona, head of the Anglican-Episcopal Church of El Salvador, said at a public forum.

In a further sign that change is afoot, a recent supreme court ruling on a 2007 case concluded that, even though the constitution declares life as beginning at conception, protection for the foetus is not absolute and it is therefore “necessary to weigh each case”.

The commission is currently considering all the evidence and must then decide whether the bill should be sent to the legislative assembly for a vote. It is understood that, should it go to the vote, there is enough opposition support in the assembly to overturn the total ban.

At the same time, a member from Nationalist Republican Alliance, the right-wing opposition party, is sponsoring a counter-bill to increase the maximum jail sentence for abortion to 50 years.