A Chinese court has upheld the validity of U.S. drug maker Pfizer Inc.’s patent for Viagra, ordering two companies to stop sales of generic versions of the erectile dysfunction treatment and pay compensation for trademark infringements, a court official said Thursday.

The Beijing No. 1 Intermediate People’s Court ordered Beijing Health New Concept Pharmacy Co. to stop sales of blue pills similar to Viagra, according to a court official who gave only his surname, Wang.