In its 132-page decision, the Ontario Court of Appeal did uphold the law that effectively criminalizes street prostitution, and modified a third law against living on the avails of the sex trade to specifically preclude exploitation.
Those in the trade hailed the overall ruling as a breakthrough, saying it makes clear that prostitutes have the same rights as other Canadians and should enhance their safety.
The federal government repeated its view that prostitution is bad for society, while anti-prostitution groups called for new laws to make it illegal to buy sex.
The court found the bawdy-house ban too broad, saying "the safest way to sell sex is for a prostitute to work indoors in a location under her control."
The court rejected Ottawa's contention that prostitutes knowingly choose an inherently dangerous occupation and therefore can't blame laws that might add to the risks.
"It implies that those who choose to engage in the sex trade are for that reason not worthy of the same constitutional protection as those who engage in other dangerous, but legal, enterprises," the five-member panel wrote.
The Appeal Court made it clear it wasn't passing moral judgment on the sex trade, only whether the laws were constitutional.
"Prostitution is a controversial topic, one that provokes heated and heartfelt debate about morality, equality, personal autonomy and safety," the ruling states. "It is not the court's role to engage in that debate."
The court suspended its declaration on brothels for 12 months to give Parliament an opportunity to draft a new law.
Prostitution itself is not illegal in Canada, though many of the key activities were banned under the three laws considered by the Appeal Court.
Speaking Tuesday in Seoul, Prime Minister Stephen Harper suggested he was happy to see the court still deemed communication for the purposes of prostitution illegal.
"We'll examine the decision and decide what the next steps are," said Harper.
"We view prostitution as bad for society and we view its affects as particularly harmful for our communities and women, and particularly for vulnerable women and we will continue to oppose prostitution in Canada."
One of the three women involved in the case, former prostitute Valerie Scott, thanked the justices for "declaring sex workers persons," saying their ruling would enhance their safety.
"We're almost real citizens (now)," Scott said. "I didn't think I would see it in my lifetime but here we are."
Lawyer Alan Young, who fought the case on behalf of the women, said he was thrilled even though the ruling didn't go as far as one by Ontario Superior Court Justice Susan Himel.
Prostitutes, he said, are no longer second-class citizens.
"We have changed the face of Canada's prostitution laws," Young said. "A new era has been ushered in."
Young was adamant Canadian society "would not collapse or even flinch" as a result of the decision, saying there would be no dramatic change in the operation of the sex-trade.
Sex workers said the various levels of government should now seek to intelligently regulate the industry to ensure brothels don't create community or social problems.
In Ottawa, Julie Di Mambro, a spokeswoman for Justice Minister Rob Nicholson, said the government was mulling its legal options.
However, she repeated Harper's contention that prostitution is an anti-social activity that harms communities, women and the vulnerable.
"We continue to see a social need for laws to control prostitution and its effects on society," Di Mambro said.
Retired dominatrix Terry-Jean Bedford, who was also part of the challenge, said the ruling vindicates those who fought the laws.
"Do you want Prime Minister Harper legislating your sex life?" Bedford said.
"We're not sex slaves. We're not going to give it away. We're not going to lay down and take the beatings any more like the police and the federal government would like us to."
When it comes to the ban on living on the avails of prostitution, the court decided the law was too broad in that it could apply to people such as a prostitute's bodyguards, accountant or receptionist.
At worst, the court said, the rules drive prostitutes "into the hands of the very predators that the law intends to guard against."
However, the provision could be salvaged by simply "reading in" words to bar living on the avails "in circumstances of exploitation," the court said.
"It introduces the requirement that the accused has unfairly taken advantage of the prostitute in his dealings with her."
The justices stayed that part of their ruling for 30 days.
The only one of the three challenged provisions the court left untouched is the effective ban on street soliciting.
"While street prostitution poses real and grave dangers to the prostitutes themselves, it also has a profound impact on the members of the surrounding community," the justices wrote.
By allowing prostitutes to move indoors given the decriminalization of brothels, any harm caused by the soliciting ban would be mitigated, the court said.
In a strongly dissenting opinion, two justices agreed with Himel's earlier ruling that easing the danger to street prostitutes should override social-nuisance concerns.
"The world in which street prostitutes actually operate is a world of dark streets and barren, isolated, silent places," the dissenters wrote.
"It is a dangerous world, with always the risk of violence and even death."
Anti-prostitution groups called on the government to make it illegal for men to buy sexual services, and to do more to support women economically so they don't have to sell their bodies.
"Prostitution is inherently dangerous and the legal changes that are currently being made in Ontario will not change that," the Institute of Marriage and Family Canada said.
Katarina MacLeod, a former 15-year prostitute now with a group that tries to rescue victims of human trafficking, said police would hamstrung in their ability to raid brothels and find underage girls.
"There's going to be no sweeps," MacLeod said.
"What about the girls that are trapped inside there? There's no voice for the voiceless any more and it just disgusts me that we're in a world where this is looked at that this is OK."
Both sides have 60 days to appeal to the Supreme Court of Canada.
Young said he would likely only appeal the street prostitution ruling if Ottawa appeals the other two rulings.
Also on HuffPost