Sierra Leone is being taken to court over its ban on pregnant girls attending school, which has denied thousands the right to finish their education.

Many girls were orphaned in the west African country’s deadly Ebola outbreak and, as they were left vulnerable and forced to fend for themselves, there was a spike in pregnancies. When schools reopened after the outbreak was contained, the government banned them from attending, to protect “innocent girls” from a bad influence.

On Thursday, two organisations will challenge the ban at a regional court as a “last resort” after previous attempts to persuade a government rethink failed. If successful, the case could be groundbreaking, putting pressure on other countries that ban pregnant girls from school, including Tanzania and Equatorial Guinea, to follow suit.

While the case is being heard at the Economic Community of West African States’ (Ecowas) community court of justice in Nigeria, girls affected by the policy will speak out at their own “people’s court” in Sierra Leone.

One, Regina, was in sixth grade when she became pregnant. She was driven out of her school and later became pregnant again.

Another, Patience, fell pregnant during the Ebola outbreak, when schools were closed, and gave birth shortly before they reopened. When she tried to go back, leaving her baby with her sister, she found the school had taken her name off the register. She fought for reinstatement, or to get a document that she could use to enrol elsewhere, but the school refused.

“They said it was bad of me to get pregnant, and they would not allow me to [go to] school because it was government policy,” said Patience, pointing out that the 25-year-old father of her child simply carried on with his life as usual. “I’m the only one who got punished, not him. It’s not fair.”

Talk of a ban first started in 2010, when a regional examination board castigated the government for “wasting money” on paying for pregnant girls to sit exams, and the education ministry resolved to act. However, little was done until 2014, when the number of pregnant girls increased significantly as a result of Ebola. In 2015, Amnesty estimated that 10,000 girls were affected.

These cases often involved sexual violence, said Judy Gitau of Equality Now, which is taking the government to court together with the Sierra Leone-based organisation Women Against Violence and Exploitation Society.

“Some had been raped, because their guardians and parents had died. Some were engaging in transactional sex to provide for their families, also because their parents had died,” she said. Activists say the ban removes the right to education from people that the state itself acknowledges are victims of crime.

Chernor Bah, a youth advocate for global education and one of the organisers of the people’s court, said Sierra Leone was “a society that pretends to not have sex at all”, even though more than 30% of girls fall pregnant and 40% are married by the age of 18.

“The problem is, the way social policy is constructed here is not based on science, not based on reason – it’s based on gut and it’s based on a facade of morality,” said Bah of the school ban, pointing out that it followed the colonial-era idea of education being a privilege rather than a right. “The idea of the female body being sexualised is offensive to so many people. And pregnancy is the ultimate acknowledgement of sex.”

The government pushed an alternative education programme for pregnant girls, funded by the UK’s Department for International Development and Irish Aid, but Bah said the standard was much lower than in normal schools and the government had refused to publish an evaluation.

“The people with the least power have the highest responsibility when it comes to morality in our society,” Bah said, claiming that even Sierra Leone’s education minister, Alpha Timbo, recently engaged in victim-blaming.

“Sometimes the women are to blame. They provoke the men to rape them,” Bah reported Timbo as saying at a recent UN conference after a screening of the film City of Joy, about rape in the Democratic Republic of the Congo.

Later, the minister denied having said this, claiming to have said: “We have to at least address our women to avoid acts of provocation … when you talk about physical violence,” and apologising only for the use of the word “provocation”.

Timbo did not respond to a Guardian request for comment.