A five-judge panel issued the ruling Monday in Toronto that will either force the federal government to appeal in the Supreme Court or redraft the existing laws in the Criminal Code, Postmedia News reported.
Prostitution is not illegal in Canada, although almost everything associated with it is, such as pimping and maintaining a brother, or "bawdy house."
The appeals court deliberated for nine months after a week of testimony based on a challenge by three female sex trade workers. They alleged their constitutional right to safety was breached by prostitution laws that forbid them from working indoors or hiring bodyguards, the news agency said.
The ruling technically means brothels are legal in Ontario until laws change or the highest court upholds the existing ones, the report said.
While it was a provincial ruling, its effects have national ramifications.
Prime Minister Stephen Harper was attending a nuclear policy summit in Seoul and told Postmedia his Conservative government would "examine the decision and decide what the next steps are."
"We view prostitution as bad for society, and we view its effects as particularly harmful for our communities and for women, and particularly for vulnerable women," he said. "And so we will continue to oppose prostitution in Canada."