A U.S. federal judge on Monday local time rejected a $100,000 fee imposed by U.S. President Trump on newly issued H-1B visas (high-skilled foreign worker visas), ruling that the fee was an illegal tax without congressional authorization. U.S. District Judge Leo Sorokin in Boston ruled on a lawsuit brought by 20 Democratic state attorneys general. In their lawsuit, the attorneys general challenged the fee, announced by Trump in September, that significantly increased the cost of obtaining H-1B visas, which U.S. technology companies in particular rely on to bring in foreign workers.

The Trump administration argued that the fee constituted a legal penalty that the president had the authority to impose under federal immigration law. Federal immigration law gives the president the power to restrict the entry of certain foreign citizens when he deems their entry to be "prejudicial to the interests of the United States."

But Judge Sorokin ultimately ruled that the fee was not a fine but a tax imposed without congressional authorization and that the U.S. State Department and U.S. Citizenship and Immigration Services had no authority to enforce.

“Whatever the payment may be called, its substance and purpose indicate that it is essentially a tax,” Judge Sorokin wrote.

The judge cited the U.S. Supreme Court's February ruling that struck down Trump's sweeping tariffs under a law designed to be used during a national emergency. Sorokin said that based on the logic of the Supreme Court’s ruling in this case, Trump also has no right to impose taxes based on immigration laws.

White House spokesman Tyler Rogers said in a statement that the Trump administration believes Sorokin's ruling will be overturned on appeal.

"President Trump has clear legal authority to restrict the entry of any foreign national he deems not to be in the best interests of the United States, and that is exactly what he has done," she said.

The H-1B visa program provides 65,000 visa quotas each year, and another 20,000 visa quotas for workers with advanced degrees, valid for three to six years. Before Trump's announcement, employers typically paid about $2,000 to $5,000 to apply for visas for foreign workers, depending on a variety of factors.

In announcing the hefty new fee, Trump said the H-1B visa program "has been deliberately exploited to replace rather than supplement American workers with low-wage, low-skilled labor."

The fee does not apply to foreign citizens already in the United States on student visas, which typically make up a large portion of new H-1B visa recipients.

Since the fee was implemented, very few employers have paid Trump’s fee. A U.S. Citizenship and Immigration Services (USCIS) official said in a March filing that as of February 15, the agency had received only 85 payments of $100,000.

The Trump administration has also ordered increased scrutiny of H-1B visa applicants and proposed a new visa selection process that would prioritize highly skilled and high-wage workers.

The $100,000 fee has prompted at least three lawsuits challenging its enforcement, including one filed by the U.S. Chamber of Commerce. The U.S. Chamber of Commerce is appealing a December ruling by a Washington, D.C., judge that dismissed the chamber’s claim that Trump did not have the authority to set the fee.