The U.S. Supreme Court on Thursday rejected a challenge to a repatriation tax Congress enacted to target the past offshore profits of U.S.-owned entities, holding that the Constitution does not forbid attributing the income of foreign companies to their U.S. shareholders.

Justice Brett Kavanaugh wrote the court’s majority opinion Thursday upholding the Mandatory Repatriation Tax, which lawmkers included in the 2017 Tax Cuts and Jobs Act to repatriate some of the trillions of dollars in past earnings of U.S.-controlled foreign corporations. Then President Donald Trump signed the MRT into law as the United States shifted from a worldwide tax system toward a territorial one.