An African regional court has ruled that a decision by the government of Sierra Leone to ban pregnant girls from school was unlawful and must be revoked immediately.
The decision by a court for countries in the West African regional bloc Ecowas has been welcomed by Amnesty International and other rights groups.
It says the ruling sent a clear message to other countries with similar bans, including Tanzania and Equatorial Guinea.
The Ecowas court said banning pregnant girls from school was discriminatory and at odds with the African Charter on Human Rights.
But the court does not have any enforcement powers. Sierra Leone and other countries have ignored previous judgements, reports the BBC's Umaru Fofana in the capital, Freetown.
The government of Sierra Leone imposed the ban four years ago when there was a spike in teenage pregnancies due to the impact of the deadly Ebola virus.
As families were torn apart many girls were left orphaned and extremely vulnerable.
The government argued that regular school would be too tiring for them and they would be a bad influence on their peers.
Alternative schools were set up for pregnant girls but rights groups argue they are not of the same standard and limit their career opportunities.