A federal judge upheld a U.S. patent for Pfizer Inc.'s (PFE) blockbuster anti-impotence pill Viagra, preserving Pfizer's market exclusivity on the drug into 2019.

U.S. Judge Rebecca Beach Smith in federal court in Norfolk, Va., ruled Friday that Teva Pharmaceutical Industries Ltd.'s (TEVA, TEVA.TV) proposed generic version of Viagra would infringe a Pfizer patent for the drug and that the patent is valid and enforceable.

The 2019 patent covers the use of Viagra's active ingredient, sildenafil, to treat erectile dysfunction. An earlier patent, covering the basic compound, is due to expire next year; Teva didn't challenge that patent.

At a trial that began in June, Teva argued that the 2019 patent was invalid and unenforceable, while Pfizer defended it.

"We are pleased that the court recognized the validity and enforceability of our Viagra patent for the treatment of erectile dysfunction," Pfizer's general counsel, Amy Schulman, said in a press release. "Protecting the intellectual property rights of our innovative core is critical, and Friday's court decision acknowledges Teva's clear violation of our patent rights."

A Teva spokeswoman couldn't immediately be reached.

Pfizer shares recently rose 2% to $18.22. Teva shares rose 1.1% to $40.14.

Pfizer's victory, if it withstands any appeals--will give it a much-needed financial boost during a tough stretch of years ahead. The drug generates about $1 billion in U.S. sales. Leerink Swann has estimated that continued market exclusivity could boost Pfizer earnings by roughly 3% annually between 2013 and 2018, a period in which profit otherwise would be under pressure due to the expected loss of exclusivity later this year for Pfizer's top-selling Lipitor cholesterol pill.

Yet Pfizer likely won't be able to retain all Viagra sales. Viagra shares the same active ingredient as Pfizer's Revatio treatment for pulmonary arterial hypertension, which is due to lose patent protection next year. Some doctors are expected to prescribe generic Revatio for erectile dysfunction, even though the doses are slightly different than Viagra.

Viagra became one of the fastest-selling drugs in medical history after its 1998 launch. Before then, men with erectile dysfunction had few options. Viagra's success, helped by ubiquitous television ads, spurred rivals to develop similar drugs, including Eli Lilly & Co.'s (LLY) Cialis.

Viagra's discovery was serendipitous. Pfizer originally had conceived sildenafil to treat heart-related conditions such as high blood pressure. The drug's composition was covered by a patent issued in the early 1990s and due to expire in March 2012.

During clinical testing, however, men taking sildenafil experienced spontaneous erections. This led to Pfizer's decision to develop the drug for ED.

Pfizer applied in the early '90s for a second patent covering sildenafil's use to treat ED, which was eventually issued by the U.S. Patent and Trademark Office in 2002. That patent is due to expire in October 2019.

In court documents, Pfizer argued that it initially wasn't obvious to people skilled in the art of drug research that an oral formulation of sildenafil could be used to successfully treat ED. Thus, Pfizer argued that its discovery was patent-worthy.

Teva argued that certain claims of the second patent are invalid because prior research would have suggested to anyone skilled in the art of drug development that drugs like sildenafil could be used to treat ED. Teva also argued the second patent amounts to "double-patenting" of Viagra.

In siding with Pfizer, Smith wrote that in the early to mid-'90s, a person trained in the art of drug development "would have no expectation that oral administration of such compounds would be successful in treating ED, and thus such method was not obvious to try."

Teva also claimed the second patent is unenforceable because Pfizer engaged in "inequitable conduct" by withholding certain information from the U.S. patent office. Teva alleged Pfizer failed to inform the office in a timely manner of a dispute surrounding a corresponding patent application in Canada. Pfizer said the information was immaterial and was ultimately disclosed to the patent office.

Teva's inequitable-conduct claim, however, stood on shakier ground following a May 25 decision by the U.S. Court of Appeals for the Federal Circuit in a patent dispute between Abbott Laboratories (ABT) and Becton Dickinson & Co. (BDX), in a case dubbed "TheraSense," a company purchased by Abbott.

The TheraSense ruling, which upheld an Abbott patent for blood-glucose test strips that had been challenged by Becton Dickinson, raised the standard for proving inequitable conduct. The appellate judges said that a patent should only be rendered unenforceable if the information withheld from, or misrepresented to, the patent office was material to the agency's decision to issue a patent.

Indeed, Smith cited the TheraSense ruling in her ruling on Viagra. She wrote there was "utterly no evidence" behind Teva's claims that the Canadian patent dispute was material to the U.S. patent application or that Pfizer intended to deceive the U.S. patent office.

"It is as if Teva hopes to conjure up the flame of inequitable conduct from thin air," the judge wrote, likening Teva's allegations to a "smokescreen."

Pfizer litigation on the 2019 patent for Viagra remains pending against other generic companies, but no trials are scheduled in those other cases.

-By Peter Loftus, Dow Jones Newswires; 215-982-5581; peter.loftus@dowjones.com

--Jonathan D. Rockoff contributed to this article.