Pfizer Inc. and its lawyers at White & Case fended off a major challenge from generic rivals on Thursday, persuading an appeals court that patents for the painkiller Lyrica give the company exclusive rights to sell the drug through the end of 2018.

A group of eight drugmakers had sought to make their own versions of the pain and antiseizure medication, which generated $3.7 billion in revenue for Pfizer in 2011. But the U.S. Court of Appeals for the Federal Circuit upheld a lower court ruling that patents are valid and infringed by the proposed copycat drugs.