Generic drugs firms may start producing versions of Viagra in Canada after a court ruled Pfizer's patent was invalid.
The Supreme Court upheld an appeal by Israel's Teva Pharmaceutical that Pfizer's original patent application was incomplete.
Pfizer has successfully defended patent lawsuits by Teva against its erectile dysfunction drug in other countries.
Pfizer said it was "disappointed" by the court's judgement.
The Supreme Court's ruling was a unanimous 7-0. The court said Pfizer had withheld disclosure of certain information about the drug.
Justice Louis LeBel wrote on behalf of the court: "As a matter of policy and sound interpretation, patentees cannot be allowed to 'game' the system in this way."
Pfizer has won patent lawsuits filed by Teva in the US, Spain and New Zealand.
Pfizer said in a statement: "In its decision, the Court determined that the Viagra patent failed to meet certain written disclosure requirements under the Patent Act. Pfizer expects to face generic competition in Canada shortly.
"Pfizer is disappointed with the Court's ruling and will continue to vigorously defend against challenges to its intellectual property. Patents provide a vital incentive for biopharmaceutical companies to invest in new and life-saving medicines that benefit millions of patients worldwide."
Viagra has gone, or is about to go, off-patent in several European countries. The timing depends on when Pfizer originally filed a patent in a country. In Canada, the patent was due to expire in 2014.