A Nigerian court has struck out a police regulation that forbids unmarried female officers from getting pregnant, local media report.

In a landmark judgment, a judge ruled that the regulation, which calls for the dismissal of any unmarried officer who gets pregnant, was “discriminatory, illegal, null and void”.

It followed a suit by a sacked policewoman who challenged her dismissal on grounds of discrimination since her male counterparts are not dismissed in similar circumstances.

“The court finds and holds that the provision [of the regulation], which applies to unmarried women police officers getting pregnant while in service but does not apply to unmarried male police officers impregnating females while they are in service, is discriminatory,” Justice Dashe Damulak ruled on Wednesday.

The court also awarded her 5m naira ($11,100; £9,100) in compensation for the violation of her fundamental right to freedom from discrimination.

It, however, ruled that she could not be reinstated to the police service, as she had sought, as she was on probation at the time of her dismissal.