Gov. Gavin Newsom of California, who announced last week that he was scaling back the project, said the Transportation Department’s move was retaliation for the border wall lawsuit, filed on Monday with 15 other states.

“It’s no coincidence that the administration’s threat comes 24 hours after California led 16 states in challenging the president’s farcical ‘national emergency,’” Mr. Newsom said in a statement. “This is clear political retribution by President Trump, and we won’t sit idly by. This is California’s money, and we are going to fight for it.”

The battle over money is just the latest clash between California and the Trump administration, which have fought over immigration, environmental and criminal justice issues. Xavier Becerra, the California attorney general, has been a vociferous critic of the administration and has filed 46 lawsuits against it so far.

(Read more about the long-running debate over California’s bullet train here.)

On Tuesday, Mr. Trump disparaged the way California had spent the rail money and the state’s role in the national emergency lawsuit. California, which “has wasted billions of dollars on their out of control Fast Train, with no hope of completion, seems in charge!” the president tweeted.

A White House spokesman declined to comment, referring questions to the Transportation Department. A spokesman for the agency said the reason for canceling the grant was clearly laid out in a letter from Ronald L. Batory, the administrator of the Federal Railroad Administration.