California on Tuesday sued the Trump administration for pulling nearly $1 billion in federal funding from the state’s high-speed rail project – a multiyear, over-budget proposal that President Trump repeatedly has mocked and Republicans have vowed to shut down.

The Federal Railroad Administration announced last week it would not give the Golden State money awarded by Congress nearly a decade ago because not enough progress had been made on the project.

The state has to complete construction on a part of the track in the Central Valley agricultural heartland by 2022 to keep the money but the Trump administration has argued there’s no way California will be able to meet the deadline.

The state’s Democratic Gov. Gavin Newsom claims pulling federal funding has more to do with California’s criticism of Trump’s controversial immigration policies and less to do with a high-speed bullet train.

CALIFORNIA'S BULLET TRAIN AND BIGGEST BOONDOGGLE IS OVER BUDGET BY BILLIONS

The state is also seeking a temporary restraining order to ask a judge to prevent the Trump administration from repurposing the money, the governor’s office said.

"The decision was precipitated by President Trump's overt hostility to California, its challenge to his border wall initiatives, and what he called the "green disaster" high-speed rail project," the state said in the lawsuit.

California has spent more than a decade trying to bring high-speed rail service between Los Angeles and San Francisco, but the project has been plagued by delays and has blown through every budget it has had.

It is now projected to cost around $77 billion and be finished by 2033.

The $929 million the Trump administration wants to take back is key for a Central Valley track segment expected to cost about $12 billion.

California was not expected to tap that funding until 2021.

The state already has spent $2.5 billion in federal funding, and the Trump administration is exploring whether it can try to get that money back.

TRUMP ADMINISTRATION DERAILS CALIFORNIA'S HIGH-SPEED RAIL PROJECT, PULLING $1B IN FUNDING

California’s embattled bullet train project has been an embarrassment for the state and has been plagued by problems almost from the start.

The idea was long championed by Newsom's predecessor, Jerry Brown.

Bullet train planners had been under increasing pressure to make progress on the system that many believe had no plausible way of living up to its goal of getting riders across the state in three hours or less.

California voters approved the pricey proposal in 2008. Backers – including several Democratic lawmakers – heralded it as an inventive concept that would connect Californians and transform transit policies down the road.

But critics claimed the bullet train project was a waste of time and money.

CLICK HERE FOR THE FOX NEWS APP

“This so-called bullet train is a solution in search of a problem that is plagued by billions of dollars in cost overruns and fiscal mismanagement,” San Diego Councilman Mark Kersey told Fox News in 2018, adding that the billions spent on the project “could have been invested in our current infrastructure needs, such as water storage, flood control, highways and bridges.”

Fox News’ Bill Mears and The Associated Press contributed to this report.