The Trump administration’s plans to pull millions in federal funding from California’s high-speed rail project is just the latest antagonism between the president and the state that stands on the opposite end of his party’s ideological spectrum.

Governor Gavin Newsom called the move “political retribution” for the state’s lawsuit against Donald Trump’s declaration of a national emergency, but California and Trump have been at it since before he was even elected president.

California, which has styled itself as the Democratic-led “resistance” to the administration, has launched 46 lawsuits against the Trump administration since Trump was sworn in. Trump and his government have taken jabs at the most populous state in the nation whenever they could as well.

Immigration has been at the forefront of this back-and-forth. Trump set his sights on California’s stance on the issue while on the campaign trail, attacking the “sanctuary city” and “sanctuary state” laws that limit local law enforcement cooperation with US Immigration and Customs Enforcement (Ice).

The state has stood behind its policies and went on to challenge Trump’s travel ban on Muslim-majority countries and his decision to end the Deferred Action for Childhood Arrivals (Daca) program. California later joined 17 other states in a lawsuit to force officials to reunite migrant families separated at the border.

Agents for immigration and customs enforcement, however, have amped up enforcement, arresting hundreds in targeted raids in sanctuary cities. In March, the justice department sued California, accusing the state of interfering with the enforcement of immigration laws.

Environmental standards have been a sore spot between California and the Trump administration as well, with the Environmental Protection Agency announcing in April that it would ease emissions standards for cars and trucks and revoke California’s ability under the Clean Air Act to impose its own greenhouse gas standards. The state filed a lawsuit against the EPA in May.

Negotiations between the state and the administration over the emissions standards fell apart on Wednesday, said Senator Tom Carper, the top Democrat on the environment and public works committee.

“This administration’s negotiations with the state of California over fuel economy and greenhouse gas emissions standards have been superficial and scant at best, or duplicitous and designed to fail at worst,” Carper said. “While I am deeply disappointed by today’s confirmation by the administration that these negotiations are over, it’s difficult for me to understand how that is the case if discussions never seriously began in the first place.”

In August, Trump blamed the state’s “bad environmental laws” for the wildfires that burned up much of the state and killed dozens. His comments did not go over well, even when he visited the hard-hit town of Paradise, which he incorrectly referred to as “Pleasure.”

California wildfires are being magnified & made so much worse by the bad environmental laws which aren’t allowing massive amounts of readily available water to be properly utilized. It is being diverted into the Pacific Ocean. Must also tree clear to stop fire from spreading! — Donald J. Trump (@realDonaldTrump) August 6, 2018

In a way, the latest announcement over the federal funding for the high-speed rail project can also be traced back to differing views on the environment. High-speed rail advocates had hoped that the multi-decade, $77bn endeavor connecting eight of the state’s largest cities by the nation’s first bullet train would finally solve the state’s notorious traffic issue and lessen the subsequent air pollution created by stalled vehicles.

When Newsom declared in his state of the state address that “the project, as currently planned, would cost too much and take too long”, Trump took that as an indication that “California has been forced to cancel the massive bullet train project after having spent and wasted many billions of dollars.”

He called it a “‘green’ disaster,” to which Newsom responded, “The train is leaving the station – better get on board!” His office later clarified that he only meant that “we have to be realistic about the project”.

A week later, the US Department of Transportation announced that it intended to cancel $929m in federal grant funds and “is actively exploring every legal option to seek the return from California of $2.5bn in federal funds FRA (Federal Railroad Administration) previously granted”.

The announcement came after California filed a lawsuit against the Trump administration over the president’s national emergency declaration – and hours after Trump tweeted, “The failed Fast Train project in California, where the cost overruns are becoming world record setting, is hundreds of times more expensive than the desperately needed Wall!”

California now wants to scale back their already failed “fast train” project by substantially shortening the distance so that it no longer goes from L.A. to San Francisco. A different deal and record cost overruns. Send the Federal Government back the Billions of Dollars WASTED! — Donald J. Trump (@realDonaldTrump) February 20, 2019

“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’,” Newsom said in a statement. “The president even tied the two issues together in a tweet this morning. 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.”