The Supreme Court of Canada says the federal government can change the definition of marriage, giving gays and lesbians the legal right to marry.

In a non-binding opinion released Thursday morning, the court reaffirmed religious freedoms under the Charter, saying religious officials opposed to same-sex marriages do not have to perform them.

It declined to answer a fourth question added by Paul Martin when he became prime minister: whether the current definition of marriage as a man and a woman was unconstitutional.

But the court said that by failing to appeal a number of lower court rulings that said excluding gays from marriage was discriminatory, the federal government had already accepted that position.

"The government has clearly accepted these decisions and adopted this position as its own," the court wrote.

Conservative Leader Stephen Harper said the court's decision to "punt" the issue back to Parliament was not what the prime minister expected, and fell in line with the Tory position.

The court rejected the argument that the traditional definition of marriage is rooted in history, saying times have changed.

"Several centuries ago it would have been understood that marriage should be available only to opposite-sex couples. The recognition of same-sex marriage in several Canadian jurisdictions as well as two European countries belies the assertion that the same is true today," wrote the court.

"I feel it is a clear green light in favour of equal marriage," said Martha McCarthy, a lawyer for same-sex couples.

Groups opposed to same-sex marriage reacted swiftly, as Gwen Landolt with Real Women and Catholic Civil Rights League member Richard Bastien called for a referendum on the issue. Landolt says the traditional definition of marriage should be enshrined in the constitution.

Prime Minister Paul Martin said he would introduce the bill to Parliament in January.

Martin has asked MPs to support the bill, but has also told them it will be a free vote.

The Liberals hold a thin minority government, with 134 of the 308 seats in the House of Commons, but should have the support of most or all of the 19 New Democrat MPs and 54 Bloc Québécois MPs.

NDP Leader Jack Layton has said his caucus will vote in favour of the bill, while Conservative Leader Stephen Harper, whose party is split on the issue, says it will be a free vote.

If passed, Canada would join Belgium and the Netherlands in making gay marriage legal nationwide.

Chrétien sent bill to court

Former prime minister Jean Chrétien sent the issue to the Supreme Court following a June 2003 ruling by the Ontario Court of Appeal allowing same-sex unions.

Ottawa has proposed changing the definition of marriage to the "lawful union of two persons to the exclusion of all others" rather than the "lawful union of one man and one woman."

Before taking it to Parliament, Chrétien referred the proposed bill to the Supreme Court, asking the justices to offer a non-binding opinion on three questions, including whether the government could redefine marriage, whether it supported the Charter of Rights and whether church groups had to perform the ceremonies.

When he became prime minister one year ago, Paul Martin added a fourth question: whether limiting marriage to a man and a woman was unconstitutional.

Along with Ontario, court rulings have now made same-sex marriage legal in British Columbia, Quebec, Saskatchewan, Nova Scotia, Manitoba and the Yukon.