Google illegally monopolized some online advertising technology markets, according to a federal judge, whose ruling marked the latest antitrust setback for the company and a challenge to its main source of revenue.

U.S. District Judge Leonie Brinkema found on Thursday that the Alphabet Inc. unit violated antitrust law in the markets for advertising exchanges and tools used by websites to sell ad space, known as ad servers. But she said the company didn’t meet the definition of a monopoly for a third market of tools used by advertisers to buy display ads.

Alphabet shares quickly sank as much as 3.2% on the ruling, then pared losses to close down 1.4% in New York.