Pfizer has settled a long-running legal dispute with Teva with a deal that will allow the Israeli company to launch a generic version of erectile dysfunction (ED) drug Viagra in the US in 2017.

Pfizer claims to have patent protection for Viagra (sildenafil) in the US until April 2020, including a six-month extension for testing the drug in young patients, but has agreed to allow Teva to launch its generic on December 11, 2017, or possibly earlier in "certain circumstances".

The deal will give Teva a couple of clear years before it faces competition from other generic rivals and - in return - it will pay Pfizer an undisclosed level of royalties on sales of its copycat version of the drug.

Viagra remains one of Pfizer's top-selling products despite having been launched around 15 years ago, bringing in sales of $2.05 billion last year around the world, including more than $1 billion from the US market alone.

This year saw the drug lose patent protection in a number of European markets, however, and sales in the first nine months of 2013 fell 6% to $1.41 billion, with third-quarter sales in Europe down more than 40% to $54 million.

More than a dozen pharma companies were due to launch generic Viagra in Europe following the patent expiry in June, with Pfizer selling a cut-price version of its own brand in order to preserve market share.

Pfizer's basic patent on Viagra expired in March 2012, but has been able to fend off legal challenges by Teva of its method of use patent, which expires in October 2019. In August 2011 Pfizer won a key lawsuit against Teva in the US District Court for the Eastern District of Virginia, which upheld the 2019 patent.

Pfizer's share price was largely unmoved by news of the settlement, staying flat at $30.25 yesterday.