Canada's top court has overturned all restrictions on prostitution, declaring that existing laws violated sex workers' right to safety.

The Supreme Court of Canada struck down bans on brothels, street solicitation, and living on the earnings of prostitution in a unanimous 9-0 decision on Friday, and gave the Canadian government one year to re-write the country's prostitution laws.

The impugned laws deprive people engaged in a risky, but legal, activity of the means to protect themselves against those risks. Chief Justice Beverley McLachlin.

While prostitution itself is technically legal in Canada, most prostitution-related activities were previously considered criminal offences.

In the decision, Chief Justice Beverley McLachlin said many prostitutes "have no meaningful choice" but to "engage in the risky economic activity of prostitution," and that the law should not make such activities more dangerous.

"It makes no difference that the conduct of pimps and johns is the immediate source of the harms suffered by prostitutes," McLachlin wrote.

"The impugned laws deprive people engaged in a risky, but legal, activity of the means to protect themselves against those risks."

The legal challenge to Canada's prostitution laws was brought by a group of sex workers who argued that the now-overturned restrictions put them in danger.

'Important day for human rights'

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

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

However, Justice Minister Peter MacKay said the government was "concerned" by the decision and was "exploring all possible options to ensure the criminal law continues to address the significant harms that flow from prostitution to communities, those engaged in prostitution, and vulnerable persons".

Don Hutchinson, vice president of the Evangelical Fellowship of Canada, a religious group that opposes the decriminalisation of prostitution, warned that the ruling could lead to increased human trafficking and victimisation of people.

"I think we're going to see an increase in cross-border traffic for those hoping to access our brothels,'' Hutchinson said.

The safety of prostitutes became a high-profile issue in Canada following the trial and 2007 conviction of serial killer Robert Pickton, who preyed on prostitutes and other women in Vancouver's Downtown Eastside neighbourhood.

Last year, a lower court in the province of Ontario struck down the ban on brothels on the grounds that it exposed sex workers to more danger.

Prostitution is legal in much of Europe and Latin America, and brothels are legal in numerous countries, including the Netherlands, Germany and Switzerland.