Plans to allow same-sex marriages will undermine teaching in Catholic schools, church representatives have warned.
The Catholic Education Commission believes Scottish Government proposals will make it impossible for teachers in denominational schools to teach according to church doctrines.
The warning comes days before Michael Russell, the Education Secretary, faces a tricky appearance at the annual conference of the Catholic Headteachers' Association of Scotland.
The Scottish Government has been consulting on whether to let churches hold same-sex weddings. Currently, same-sex couples can enter a civil partnership, but the ceremony cannot be conducted in a church or other religious premises.
The Catholic Church and the Church of Scotland oppose the idea. Islamic clerics from the Council of Glasgow Imams called it an attack on their faith.
Michael McGrath, director of the Scottish Catholic Education Service, said: "Despite the First Minster's rhetoric of support for faith communities and for denominational schools, this Government's actions appear to be designed to undermine both.
"While the First Minister has expressed his admiration of Catholic schools for their moral teaching, it is ironic that this legislation attempts to set aside one major item of Christian moral teaching – the sanctity of marriage as a covenant between husband and wife.
"This understanding of the sanctity of marriage is divinely ordained in Church doctrine and underpins the teaching of marriage in Catholic schools across the world."
Mr McGrath said in Scotland's 373 Catholic schools, teachers provided opportunities for learning about the "complementarity of man and woman" and the rearing of children within the family setting "ideally with a mother and a father".
He added: "The commission, in its response to the consultation, has expressed significant concern that, if such legislation were enacted, it would become impossible for teachers in Catholic schools to teach conscientiously, according to the doctrines of the Catholic Church, as parents expect them to do.
"While the right of teachers in faith schools to promote the doctrines of a school's denominational body is recognised in the Equality Act 2010, the commission is concerned that teachers would be compelled to teach according to the policies of their employers – local councils.
"Such policies would certainly require the teaching of marriage as a legal contract, rather than any doctrinal understanding of marriage as a Sacrament."
In January, leaders of the Labour, Liberal Democrat, Green and Conservative parties signed a pledge supporting a campaign to legalise same-sex marriage.
The Scottish Government then held a 14-week public consultation on the issue and said it "tends towards the view" that same-sex marriage should be introduced, but that faith groups and their celebrants should not be obliged to solemnise the ceremonies.
A spokesman said the Government is now analysing responses to the consultation and considering what to do next.
He added: "We have given an assurance that all opinions will be listened to, no final views have been reached and therefore no decisions have been taken. The analysis of the responses will be published later in the spring."