Canada's Supreme Court has started a three-day hearing on whether gay marriage is constitutional.
Lawyers for the government opened the session by arguing that allowing same-sex marriage was a matter of justice.
One judge said in response that the government appeared to be asking the court to do its political work.
Gay marriages are legal in five provinces and one territory, but they are not recognised in Canada's other five provinces and two territories.
Observers say that in the run-up to the hearing, few advocates expected the court to rule against the government's plan to make gay marriage legal across the country.
"We are very confident that the Supreme Court will confirm what many judges have said across the country," Laurie Arron of the gay advocacy group, Egale Canada, told the Associated Press.
The court is not expected to give its ruling until next year.
The government has promised a free vote on the issue in parliament after the ruling.
Church rights
The hearing by the country's highest court is examining whether draft legislation allowing same-sex unions is constitutional.
Gay groups say a favourable ruling would be an important step towards ending the stigma of homosexuality.
Opponents of the draft law argue that it infringes on the right of churches to refuse to perform same-sex marriages.
"When we redefine marriage, we are telling Canadian society and we are telling our young people that gender doesn't matter," Derek Rogusky of Focus on the Family Canada added.
"Study after study shows that gender does matter."
Canada would join the Netherlands and Belgium in legalising same-sex marriages.
Last month, a court in the Canadian province of Ontario approved what is thought to be the world's first gay divorce.