Sierra Leone has overturned a five-year law barring pregnant girls from going to school.
The ban was introduced in 2015 as schools reopened after the Ebola crisis, which saw a rise in pregnancies among school-age girls.
West Africa's top court ruled in December that the girls were discriminated against and their human rights violated.
Teenage pregnancy is a huge issue in Sierra Leone.
The UN children’s agency Unicef in a 2015 report found that 40% of girls are married before their 18th birthday.
Several rights organisations sued the Sierra Leone government at the Economic Community of West African States (Ecowas) court in May 2018.
The court ruled last year that the “discriminatory” policy had denied the girls their right to education.
Judges also criticised parallel learning centres that had been set up for the girls, saying it was “another form of discrimination” and ordered that they be abolished.
President Julius Maada Bio, who had come into office a month earlier, said in a statement after the December ruling that he was committed to "inclusion of every citizen” in his development plans.
There was an increase in underage pregnancy during the Ebola crisis, which left many girls vulnerable to sexual abuse and desperate for money.
Analysis: The stigma will continue
By Umaru Fofana, Freetown
Sierra Leone is a very traditional society. Many say much of the beliefs are misogynistic. It is a country where former President Ernest Bai Koroma refused to sign into law an abortion bill that was unanimously passed by parliament. Many activists say men are determining the future of women without regard to the women themselves.
Female genital mutilation is widespread, with an equally widespread resistance to stopping it by traditionalists. Any attempt to do so is resisted, with accusations of "foreign cultural interference".
During the Ebola outbreak in 2014 and 2015, the government closed all schools in order to halt the spread of the disease. Consequently, hundreds - some say thousands - of girls became pregnant. A 2010 policy of not allowing pregnant girls in school came to the fore. So the girls were shut out of school and not allowed to write their exams.
The policy received widespread public support and still does.
Memunatu Margao, a shop attendant in central Freetown, expressed disappointment with the overturning of the ban: "I will not allow my daughter to sit in class with someone pregnant - that's a very bad influence".
Asked whether she would keep her daughter in school if she became pregnant, the mother of two said emphatically: "No! She will stay at home."
But Education Minister David Moinina Sengeh described it as a great day for the children of Sierra Leone, and said the policy shift "was based on evidence and consultation with a diverse task force consisting of religious leaders, heads of schools and civil society organizations".
He said that "at a time of uncertainty, when schools are closing for what seems like an indefinite time for Covid-19, Sierra Leone is learning from its experience during the Ebola crisis".
A new policy of inclusion would apply to "all learners", while the government would also "engage communities to prevent teenage pregnancies", he added.
But many here believe that while the official policy may have changed, the stigma against pregnant girls will continue, so the girls may be kept out of school for a different reason.
The issue of pregnant girls going to school is also a big issue on the other side of Africa, in Tanzania.
President John Magufuli has defended the policy of banning pregnant girls from school, saying young mothers would be distracted if they were allowed back in school.