The U.S. Supreme Court ruled unanimouslyTuesday that patent holders cannot sue people or companies who refurbish or resell products based on their patents, making it more difficult for manufacturers and drugmakers to control how their products are sold on secondary markets.

The decision was handed down in a case between U.S.-based and Chinese-owned printer and imaging products manufacturer Lexmark and refurbished ink cartridge seller Impression Products.

Read: Did Samsung Copy Apple? The Supreme Court Patent Infringement Case Explained

The case originally was brought by Lexmark, which sued Impression Products in Ohio federal court in 2010 on the grounds the small business was infringing on patents owned by Lexmark by refilling and reselling printer ink cartridges. Lexmark argued it retained patent rights to the cartridges even after their sale.

The Supreme Court disagreed with Lexmark’s assertions, finding the company cannot restrict how its products are used by consumers and resellers. Lexmark’s contract with buyers includes a right to sue for patent infringement, but the court rejected the company’s use of patent law to attempt to control ownership rights of a person who purchases the product.

The decision effectively finds when a patent holder sells a product, it cannot use that patent to try to control how the buyer uses it. Lexmark could sue the buyer for breach of contract if they resell a printer cartridge when they explicitly agree not to, but the company cannot sue for patent infringement.

The court also ruled 7-1 companies that hold patent rights in the U.S. cannot control what happens to that product if it is sold overseas. "An authorized sale outside the United States, just as one within the United States, exhausts all [patent] rights," Chief Justice John Roberts wrote in the majority decision.

The ruling reverses a two-part ruling by the U.S. Court of Appeals for the Federal Circuit, which found in favor of Lexmark in 2016.

Read: Drug Price Debate: Can An Obscure Supreme Court Patent Case Lead To Lower Prescription Prices?

Justice Ruth Bader Ginsburg offered a partial dissent in the ruling. While she agreed with the other justices that Lexmark could not enforce restrictions on its products after sales by using patent laws, she argued that patent owners should still have the ability to maintain patent rights on products they sell overseas.

Justice Neil Gorsuch, President Donald Trump’s nominee to fill the vacancy on the court that had been open since the death of Justice Antonin Scalia, had not yet been confirmed to the court when it heard arguments in the patent case and did not participate in the decision.

The ruling is being viewed as a blow to the tech and pharmaceutical industries, which rely heavily on their ability to retain patent rights, especially when selling overseas where resellers may be able to buy products at a cheaper price and import them back into the U.S.

The Electronic Frontier Foundation, a nonprofit digital rights advocacy group, called the decision a “victory for the right to tinker,” stating, “the court's reasoning will help us protect your rights from overbroad copyright and other restrictions, like the ones written into ‘end user license agreements’ for software or imposed by technological restrictions.”