Image caption The Conservative government cited the need to protect prostitutes

The Canadian government is to appeal against a provincial court ruling overturning bans on pimping, soliciting and brothels, officials have said.

Conservative officials vowed to defend the laws found unconstitutional, saying prostitution harms women in the trade.

The Ontario Superior Court of Justice ruled in favour of three prostitutes who argued the bans forced them to risk their safety on the streets.

The laws remain in place during a 30-day stay of the ruling.

"Anyone that believes that women involved in the sex trade are not victims is very mistaken," Bob Dechert, parliamentary secretary for Justice Minister Rob Nicholson, told CBC news.

"There's a lot of victims in that industry and we need to protect them."

In a 131-page ruling, Judge Susan Himel found national laws banning brothels, solicitation of clients and managing sex workers violated a provision of the constitution guaranteeing "the right to life, liberty and security".

She called on the Canadian parliament to regulate the sex trade rather than ban such practices.

"These laws... force prostitutes to choose between their liberty, interest and their right to security of the person," she said.

In remarks to reporters on Tuesday, the three women described the ruling as providing greater protection for sex workers, with one likening it to "emancipation day".

The ruling affects only the province of Ontario, but if the government loses the appeal it could lead to changes in the law nationwide.