The Scottish Government is facing legal action in a bid to give pupils the ability to opt-out of religious observance at school.

Humanist Society Scotland (HSS) believes the government's current stance of requiring parental permission to opt-out is an infringement on children's human rights.

They claim ministers acted unlawfully when they decided not to update policy after the UN children's rights committee called for Scotland to scrap compulsory religious observance in public schools.

On Friday, HSS was given permission to proceed with a judicial review against the Scottish Government by Lord Armstrong at the Court of Session.

HSS chief executive Gordon MacRae said the legal action was only being taken after "exhausting every other avenue".

He said: "Today's decision is a green light to continue our efforts to ensure that young people in Scotland are able to enjoy the same rights as adults to freedom of thought, belief and religion.

"It is disappointing that the Scottish Government is continuing with its attempts to block our arguments for children's rights being heard. We are delighted that the overwhelming case for children's rights continues."

Mr MacRae added: "It was never our preference to have to rely on the courts to ensure that the rights of young people in Scotland are respected and enforced.

"However, having exhausted every other avenue available to us, we feel it is time to clarify this issue once and for all.

"It remains clear to us that the Scottish Government has acted unlawfully by refusing to update its guidance on religious observance. However, we remain open to offers to work together and resolve the matter directly."

The decision comes two weeks after around 50 pupils at Taylor High School in New Stevenston were given detention after playing truant during annual Mass.

No date for has been set for a substantive hearing but HSS said it is expected to be held in early 2017.

A Scottish Government spokesman said it would not be appropriate to comment specifically in relation to the ongoing court proceedings.

He added: "Parents are legally entitled to withdraw their children from religious observance in all Scottish schools and the flexible approach afforded by Curriculum for Excellence encourages schools to discuss options with both parents and their children, including in relation to a decision to withdraw from religious observance.

"Religious observance, which many schools refer to as time for reflection, is considered a whole school activity that should be open and inclusive to all faith and non-faith pupils unless a parent has withdrawn their child."