LONDON (Reuters) - Pfizer suffered a major setback in Britain on Thursday when the High Court in London ruled that claims of patent protection for the use of its $5 billion-a-year drug Lyrica as a pain treatment were invalid.

Lyrica, known generically as pregabalin, was originally developed for epilepsy. However, further research showed it could also help patients suffering from neuropathic pain and most prescriptions are now written for pain.

While the original patent on pregabalin expired last year, Pfizer was awarded a secondary patent covering pain, valid until July 2017, and the U.S. drugmaker had been fighting to protect this lucrative section of the market.

The expiry of the basic patent allowed generic drugmakers including Actavis, now renamed Allergan, to launch cut-price versions of the medicine, which carried a so-called "skinny label" limiting their use to epilepsy and general anxiety disorder.

But Pfizer still sued, arguing it was inevitable that the copycat versions would be dispensed for pain as well as non-pain conditions.

The issue was further complicated by the fact that British doctors, who typically write prescriptions using a drug's generic name, were told by the National Health Service (NHS) to only prescribe branded Lyrica for pain, angering some medics.

In the event, the court decided that generic companies had not infringed Pfizer's secondary patent and its patent claims directed generally to pain and neuropathic pain were invalid.

"Pfizer is liable for making groundless threats of patent infringement proceedings," the court said in a lengthy judgment.

In a statement, Pfizer said it maintained its strong belief in the validity and importance of the second medical use patent for pain and it intended to appeal the ruling.

Since four out of five prescriptions for the drug in Britain are written for pain, the setback is significant for Pfizer. The NHS spent nearly 250 million pounds ($386 million) on the medicine last year, or around 7.5 percent of Lyrica's worldwide sales of $5.2 billion.

The case is specific to Britain and has no direct implications for other markets, where Pfizer also has secondary patent protection for Lyrica in pain.

Pfizer argues such secondary patents are essential if companies are to investigate and spend research dollars in novel uses of drugs, which may bring important benefits to society.

In the case of Lyrica, Pfizer said it had conducted more than 50 clinical studies involving some 12,000 patients specifically to assess the efficacy and safety of Lyrica in neuropathic pain, a chronic condition involving nerve damage.