The Trump administration on Thursday followed through with its plan to pull more than $900 million in federal funds from California’s beleaguered high-speed-rail project.

The U.S. Department of Transportation said California officials “failed to make reasonable progress” and had not met federal requirements for a project beset with cost overruns. But the decision is also consistent with President Trump’s penchant for sparring with leaders of the liberal-leaning state.

After Gov. Gavin Newsom (D) in February proposed reducing the scope of the rail project, Trump tweeted that the project was a “green disaster” that “wasted many billions of dollars.”

“They owe the Federal Government three and a half-billion dollars,” Trump tweeted.

In addition to revoking the federal government’s agreement to contribute $929 million to the project, the administration Thursday said it “continues to consider all options regarding the return of $2.5 billion” in stimulus funds given to the state.

California officials have argued that Trump’s decision to pull federal funding from the project was payback for the state’s opposition to Trump’s promised border wall.

In February, Trump tweeted: “California, the state that has wasted billions of dollars on their out of control Fast Train, with no hope of completion, seems in charge” of efforts by a number of states to oppose the wall.

On Thursday, Newsom called the Trump administration’s final decision an “illegal and a direct assault on California” and the thousands of workers building the project.

“Just as we have seen from the Trump Administration’s attacks on our clean air standards, our immigrant communities and in countless other areas, the Trump Administration is trying to exact political retribution on our state,” Newsom said in a statement. “This is California’s money, appropriated by Congress, and we will vigorously defend it in court.”

A March report from the California Legislative Analyst’s Office pointed to a massive funding shortfall for the project. A line from San Francisco to Anaheim would cost $77.3 billion, according to the analysis. Even with the federal money, the funding gap is between $54.9 billion and $58.2 billion, according to the analysis.

“The Governor stated that the project as planned would cost too much and take too long, and indicated that there is not a path to complete” the original route, it said.

In a March 4 letter, Brian P. Kelly, chief executive of the California High-Speed Rail Authority, had called on the Trump administration to rethink its plan to cancel the more than $900 million, saying the “clawback” of federal funds “would be disastrous policy.”

“It’s hard to imagine how your agency — or the taxpayers — might benefit from partially constructed assets sitting stranded in the Central Valley of California … one of the nation’s most economically distressed regions,” Kelly wrote. “This infrastructure legacy would forever be a travesty.”

Kelly said that Newsom was seeking “a pragmatic approach to using the funding now committed to this project to get high-speed trains on the ground in California as soon as possible.” That means first finishing “an early high-speed rail link” between Merced and Bakersfield in the central valley, continuing regional projects in the north and south of the state, and securing environmental clearances for “segments from San Francisco to Los Angeles/Anaheim,” Kelly said.

But on Thursday, a statement from the Federal Railroad Administration (FRA) said “California has abandoned its original vision of a high-speed passenger rail service connecting San Francisco and Los Angeles, which was essential to its applications for” federal grant money.

In a letter to California officials, FRA Administrator Ronald L. Batory said the state had originally proposed an “800-mile, statewide system” with speeds up to 220 miles per hour “connecting the Bay Area, the Central Valley, Sacramento, and Southern California.”

Batory said the first phase, as described by California rail officials when they applied for federal funds, was to involve “the construction of approximately 520 miles between San Francisco and Anaheim, connecting two metropolitan regions and more than 25 million people.”

Now, the inaugural stretch would be between Merced and Bakersfield.

That “dramatically reduced scope … is simply not consistent” with what California originally promised, Batory said. He also said California “was plainly unable, and, even if it were able, appeared unwilling, to comply with the required amounts and timelines for the State contribution required” by its federal commitments.

The Trump administration has sent mixed messages on the value of high-speed rail, and of rail generally.

In the first weeks of his administration, echoing campaign rhetoric about plans for far-reaching infrastructure spending, Trump seemed to bemoan the fact that America lacked high-speed rail lines.

At a White House meeting with aviation industry executives, Trump noted that China and Japan “have fast trains all over the place. We don’t have one. I don’t want to compete with your business — but we don’t have one fast train.”

But Trump’s budget proposals have called for cutting money for rail and transit projects as well as federal backing for Amtrak.