The federal government will appeal an Ontario court ruling that struck down Canada's ban on brothels.

Justice Minister Rob Nicholson said Wednesday "a binding, national decision is needed on the constitutionality" of the Criminal Code sections pertaining to bawdy houses, as well as the ban on living on the avails of prostitution.

In March, the Ontario Court of Appeal struck down the ban on common bawdy houses, but said the ban on communicating for the purposes of selling sex should stand.

The court also said that the law against living off the avails of prostitution should be rewritten so that it applies only "in circumstances of exploitation."

"It is our position that the Criminal Code provisions are constitutionally sound. It is important to clarify the constitutionality of the law and remove the uncertainty this decision has created," Nicholson said in a statement.

"The Criminal Code provisions denounce and deter the most harmful and public aspects of prostitution."

The statement said the government will not comment further as the matter is before the courts.

Advocates for sex-trade workers hailed last-month's ruling. Lawyer Alan Young, who launched the appeal, said the decision signals that prostitutes are no longer second-class citizens who should "just be quiet about their plight."

He said: "The new spring has come for sex workers, a new era has been ushered in."

While accepting money in exchange for sex is not illegal in Canada, there have been bans on soliciting, living on the avails of prostitution and keeping a common bawdy house.

In 2010, Ontario Superior Court Justice Susan Himel ruled that laws banning those activities were fundamentally unjust and made life dangerous for sex-trade workers.

The federal government appealed that decision, arguing that the laws help police deal with prostitution while protecting sex-trade workers from pimps.

But the Ontario Court of Appeal ruled that the ban on brothels puts prostitutes in danger by forcing their work outdoors.

The court said the brothel ban was too broad because "it captures conduct that is unlikely to lead to the problems Parliament seeks to curtail." It said the impact is "grossly disproportionate" to the law's intent because "the safest way to sell sex is for a prostitute to work indoors in a location under her control."

The court suspended its ruling on brothels for one year to allow Parliament time to write a new law.

The court also said that by re-writing the law against living off the avails of prostitution, prostitutes would be able to hire bodyguards to ensure their own safety.

But the court did uphold the ban on solicitation, saying prostitution has "a profound impact on the members of the surrounding community."