Nigerian Muslims have welcomed a court ruling allowing girls to wear headscarves in government schools in Lagos state, hailing the decision as a victory for the rule of law.

The Muslim Rights Concern group (MURIC) said the Court of Appeal's decision, which overturned a years-long ban preventing girls from wearing the garment, had "restored hope in the judiciary".

"The fact that the judgment was unanimous and only two of the five judges are Muslims leaves a firm stamp of authority on the legality of the use of the hijab not only by female Muslim students but also by all Muslim women in the country," MURIC said.

READ MORE: Meet Hijarbie, the popular doll wearing Muslim fashion

Alhaji Abubakar, the president-general of the Nigerian Supreme Council for Islamic Affairs, also applauded the decision. 

"Muslims are not forcing anyone to use the hijab (headscarf) ... but whoever wants to use hijab must be allowed to use hijab," Nigerian website Today quoted Abubakar as saying on Saturday.

Nigeria has a roughly equal Christian-Muslim mix and more than 200 ethnic groups live side by side in the West African country.

Though generally peaceful, Nigeria has seen periodic bouts of violence since the armed group Boko Haram launched a campaign in the northeast of the country.

Inside Story - Can Boko Haram be defeated?

Source: Al Jazeera and agencies