Updated

Canada's highest court struck down the country's anti-prostitution laws Friday, a victory for sex workers who stepped up their fight for safer working conditions following the serial killings of prostitutes by a pig farmer in British Columbia.

The 9-0 Supreme Court ruling found that the laws violated the guarantee to life, liberty and security of the person. But the ruling won't take effect immediately because it gave Parliament a one-year reprieve to respond with new legislation.

Prostitution isn't illegal in Canada, but many of the activities associated with prostitution are classified as criminal offenses.

The high court struck down all three prostitution-related laws: against keeping a brothel, living on the avails of prostitution, and street soliciting. The landmark ruling comes more than two decades after the Supreme Court last upheld the country's anti-prostitution laws.

The decision upheld an Ontario Court of Appeal ruling last year that struck down the ban on brothels on the grounds that it endangered sex workers by forcing them onto the streets.

Chief Justice Beverley McLachlin, writing on behalf of the court, said Canada's social landscape has changed since 1990, when the Supreme Court upheld a ban on street solicitation.

"These appeals and the cross-appeal are not about whether prostitution should be legal or not," she wrote. "They are about whether the laws Parliament has enacted on how prostitution may be carried out pass constitutional muster. I conclude that they do not."

A Vancouver sex worker who was part of a group that brought the case applauded the court's decision.

"I'm shocked and pleased that our sex laws will not cause us harm in a year," Amy Lebovitch said in a news conference.

Katrina Pacey, a lawyer for the group, called it "an unbelievably important day for the sex workers but also for human rights."

"The court recognized that sex workers have the right to protect themselves and their safety," she said.

Sex-trade workers argued that much has happened since the high court last considered prostitution, including the serial killings of prostitutes by Robert Pickton in British Columbia. Pickton was convicted in 2007 of killing six women whose remains were found on his farm outside Vancouver.

In 1990, the two women on Canada's Supreme Court dissented on the ruling upholding the ban on street solicitation. This time, all six men on the court justices sided with their three female colleagues.

"The harms identified by the courts below are grossly disproportionate to the deterrence of community disruption that is the object of the law," McLachlin wrote. "Parliament has the power to regulate against nuisances, but not at the cost of the health, safety and lives of prostitutes."

The Supreme Court appeared to acknowledge the Pickton case in the ruling, saying: "A law that prevents street prostitutes from resorting to a safe haven such as Grandma's House while a suspected serial killer prowls the streets, is a law that has lost sight of its purpose."

Grandma's House was a safe house established to support street workers in Vancouver's drug and violence-riddled Downtown Eastside, at about the same time as fears were growing that a serial killer was prowling the streets. Bawdy House charges forced the house to close in 2000. The charges were stayed four years later, but by then it was too late.

The Supreme Court also struck down the law that makes living off the avails of prostitution illegal, rejecting the Ontario government's argument that it is designed "to target the commercialization of prostitution and to promote the values of dignity and equality."

The three principles in the case are: Lebovitch, retired dominatrix Terri-Jean Bedford and former prostitute Valerie Scott, of Toronto.

Parliament could ask the Supreme Court for an extension on the effect of the ruling, if it has tabled legislation but can't meet the one-year deadline.

The ruling told Parliament it needs to reshape the legal framework around prostitution.