A federal appeals court has upheld a previous ruling that pharmaceutical giant Bayer Schering’s U.S. patent for its Yasmin oral contraceptive is invalid, opening the way for Barr Laboratories Inc to sell a generic version.

The U.S. Court of Appeals for the Federal Circuit ruled 2-1 that Bayer’s patent was invalid “because we hold that the invention would have been obvious.”

The case pitted Bayer Schering Pharma AG against generic drug maker Barr Laboratories Inc, which is distributing a generic version of Yasmin called Ocella in the U.S.

That drug had annual sales of about $170.2 million in the U.S. in 2008, based on IMS sales data, said Barr parent company Teva Pharmaceuticals Industries Ltd.