The Supreme Court of Canada has ruled that Quebec infringed on the religious freedom of a Catholic high school in Montreal by requiring it to teach the province's Ethics and Religious Culture program.

But the high court was divided by a 4-3 margin on how to resolve the clash between religious freedom and the need to follow the secular law of the province.

Led by Chief Justice Beverley McLachlin, the minority said they didn't think the majority struck the right balance between protecting freedom of religion and the need to follow the law.

In the narrowest legal sense, the ruling grants the appeal by Jesuit-run Loyola High School, which wants to be allowed to use its own course and teach the province's Ethics and Religious Culture program from a Catholic perspective.

The school can now reapply to Quebec's Education Ministry for an exemption to teach the program and that decision must be guided by Thursday's ruling.

"The Ethics and Religious Culture program was conceived as a way to teach students to recognize the value of others and the pursuit of the common good," former Loyola principal Paul Donovan told reporters after the judgment was handed down.

"These are laudable goals that we share and wish to inculcate in our students. However, we do not believe that religious values in the context of our school need to be suppressed to accomplish this."

Quebec Education Minister François Blais said he wouldn't immediately comment on the ruling. 

"I know, by and large, the reasons, the motivations and the importance of this course," he told the National Assembly today during question period. 

"So, we support this course, our [support is] unwavering, and we will now take the time to read the whole  debate opened by the Supreme Court."

The decision comes amid the backdrop of political, cultural and religious acrimony that has arisen in Ottawa around the issues raised by Prime Minister Stephen Harper's position that women taking the oath of citizenship should not be allowed to wear a face-covering niqab.

The high court ruled on the issue in 2012 in a similar case in Drummondville, Que., involving a public school.

In that case, the Supreme Court ruled that teaching students about world religions did not infringe the rights of Catholic parents who wanted to raise their children in their faith.

Secular perspective challenged

Today's case revolves around Quebec's law that requires schools to teach religions from a secular, cultural and morally neutral perspective in private schools.

The ministry initially turned down Loyola's request for an exemption, but at trial, a judge in the Superior Court of Quebec ruled in favour of the school and granted it.

The Quebec Court of Appeal reversed that decision, saying that even if there was, the effect was trivial because the ethics course was one among many.

That ruling was overturned by the Supreme Court Thursday.

Loyola High School

Loyola High School, a private boys school in Montreal founded by Jesuits, aims to teach with a Catholic perspective. The school sought an exemption from Quebec's wider curriculum on ethics and religious culture. (CBC)

Schools can apply for an exemption that allows an alternative course to be taught as long as the minister of education approves it. Schools are only allowed to teach an alternative course as long as teachers steer clear of injecting their own religious beliefs.

"To ask a religious school's teachers to discuss other religions and their ethical beliefs as objectively as possible does not seriously harm the values underlying religious freedom," Justice Rosalie Abella wrote for the majority.

"But preventing a school like Loyola from teaching and discussing Catholicism in any part of the program from its own perspective does little to further those objectives while at the same time seriously interfering with the values underlying religious freedom."

Loyola's exemption, the court held, "cannot be withheld on the basis that Loyola must teach Catholicism and Catholic ethics from a neutral perspective."

Benoît Boucher, who represents Quebec's attorney general, said all non-secular schools can teach their religion from a religious point of view, but said he does not think there will be many requests to do so. 

He said it was important for the province to continue teaching the course and the judgment shows that it should be mandatory for all Quebec students to gain a thorough understanding of diversity. 

"It was important for us that this program was maintained, and it has been. "

With files from CBC News