A federal judge has ruled that Irvine-based Allergan Inc.’s patent on its Lumigan glaucoma drug is valid and was infringed upon by two generic versions.

U.S. District Court Judge Sue Robison ruled that Barr Laboratories Inc., a unit of Israeli drug maker Teva Pharmaceutical Industries Ltd., and Sandoz, a unit of Switzerland’s Novartis AG, failed to prove that Allergan’s patents protecting Lumigan were invalid.

Barr and Sandoz filed regulatory applications to make Lumigan generics in 2009.

Allergan then sued the companies for patent infringement.

Lumigan has annual sales of about $650 million, which makes it among the largest of Allergan’s prescription eye drugs.

Allergan is best known for its Botox, which is to smooth wrinkles and in several therapeutic uses such as treating severe migraine headaches. The company counts about $5 billion in revenue overall.

Teva has a manufacturing plant in Irvine, where it employs 500 workers, according to a recent Business Journal list.