A consultation is to be held on whether older pupils should be allowed to opt themselves out of religious observance in schools, the BBC has learned.
All young people in Scotland need parental permission to withdraw from religious activities like assemblies.
The Humanist Society of Scotland (HSS) was seeking a judicial review of that policy for older pupils.
The Scottish government is now to consider revising guidance to head teachers.
Religious observance must take place in Scottish schools at least six times a year.
In England and Wales, sixth form pupils - normally aged between 16 and 18 - have the right to make their own decision about opting out.
The HHS called for older pupils in Scotland to be given the same right.
It came after a report by the UN committee on the rights of the child highlighted the fact that children in Scotland were not able to legally withdraw from religious observance.
It recommended that laws requiring compulsory attendance at religious worship were scrapped.
At that time, the Scottish government ruled out a review of the policy.
This prompted the HSS to take a legal challenge to the Court of Session, arguing that the government may have acted unlawfully by refusing to ensure their guidance remains in line with international humans rights law.
Now the Court of Session has granted a motion to halt that judicial review action for three months.
This was put forward by Scottish ministers with the consent of the HSS.
The three-month period will be used to carry out a consultation which will consider a revision of the guidance on religious observance in schools.
A Scottish government spokesman said: "We believe religious observance in schools should support the values of a diverse, outward-looking Scotland, which encourages young people to develop their own beliefs and values, and understand and respect the beliefs and values of others.
"Listening to the views of young people themselves on all aspects of education is very important, as we have clearly recognised through our approach in the Children and Young People (Scotland) Act 2014 and the current Education Governance Review.
"We welcome the opportunity to work with key interests to discuss how we ensure this approach is fully reflected through religious observance guidance."
The HSS has welcomed the consultation. Chief executive Gordon MacRae said: "I think we still live in a country where there's a perception that there are big religious voting blocks and people don't want to rock the boat.
"I don't think that's necessarily true and I don't think this is an issue that should be religious v non-religious.
"There are many people of faith who also recognise it's not helpful to force young people to attend religious observance against their will."
The Church of Scotland welcomed the consultation on religious observance guidance and said it was a decision that should taken by "Scotland as a whole".
Rev Dr Richard Frazer, convener of its church and society council, added: "The point is that you wouldn't give children the opt-out from mathematics or English.
"There are certain important lessons that we need to learn in society. And I suppose the Church of Scotland's perspective is that learning about other faiths, about how people live their lives, is important."
Barbara Coupar, from the Scottish Catholic Education Service, said: "It's recognised that when parents choose to send their children to a Catholic school they are choosing to send them to a school which is based on the heritage and traditions of the Catholic church.
"And therefore that is integrated into everything we do, not just into religious education, and not just into assemblies, but also other curricula areas and other parts of the school life."