WASHINGTON — The Supreme Court on Monday placed tight limits on where patent lawsuits may be filed — a unanimous decision that was a blow to so-called patent trolls, or companies that buy patents not to use them but to demand royalties and sue for damages.

Such companies have often sued in remote federal courts that have a reputation for friendliness to plaintiffs. More than 40 percent of patent lawsuits, for instance, are filed in a federal court in East Texas.

In recent years, a single judge based in Marshall, Tex., oversaw about a quarter of all patent cases nationwide, more than the number handled by all federal judges in California, Florida and New York combined.

Monday’s decision was a victory for big technology companies and other patent holders, which have complained about what they called forum shopping in patent cases. Other companies have argued that it makes sense to let cases be considered by courts that have developed expertise in patent matters.