President Donald Trump called a big California bluff on Thursday, telling the Golden State's Democratic governor that the federal government won't pay for a National Guard deployment to the U.S.-Mexico border if troops are forbidden from helping secure it.

'Governor Jerry Brown announced he will deploy "up to 400 National Guard Troops" to do nothing,' Trump vented on Twitter, after the governor had appeared to strike a deal with the Department of Homeland Security that would have allowed California's Guard detachment to perform a limited set of duties.

'The crime rate in California is high enough, and the Federal Government will not be paying for Governor Brown’s charade,' the president added. 'We need border security and action, not words!'

Brown had said he would permit the Guard troops, which officially operate under his command, to work on fighting gangs and drug and gun smugglers.

But after a week of wrangling with the White House, he continued to insist the men and women he deploys may not apply their energy toward shoring up border security or keeping illegal immigrants out of the country.

President Trump has called up, but not federalized, National Guard troops to participate in border-control activities until his long-promised wall is erected – but California's governor is putting conditions on his state's deployment

Trump called Gov. Jerry Brown's bluff on Thursday, saying that the federal government won't pay for a 'charade' involving Guardsmen and women who go to the border 'to do nothing' instead of helping to secure the border and keep illegal immigrants from entering the U.S.

Gov. Brown had said he'd cut a deal with the Trump administration for his state's National Guard to help fight gangs and gun smugglers at the border – but not illegal immigration

Homeland Security Secretary Kirstjen Nielsen wrote on Twitter that final details were still being worked out 'but we are looking forward to the support.'

That now appears premature.

Brown claimed Wednesday that he had secured federal funding on terms similar to those outlined in the contract he proposed last week: The Guard cannot handle custody duties for anyone accused of immigration violations, build border barriers or have anything to do with immigration enforcement.

He offered last week to send 400 troops, but also insisted that a list of tasks that could relate even marginally to immigration enforcement – including vehicle maintenance, radio communications, buying gasoline, handling payroll and clerical work – were off-limits.

Secretary of Homeland Security Kirstjen Nielsen tweeted late Wednesday night that '[f]inal details are being worked out' but an agreement appears imminent – and then Trump contradicted her in his own tweet

Trump slammed Brown's posture on sending National Guard troops to the Mexican border earlier in the week, after it became clear that even clerical work and fixing trucks would be off-limits for the California detachment

Brown's inflexibility appears to be in line with Californians' views. A poll released Thursday by UC Berkeley's Haas Institute shows 66 per cent reject Trump's assertion that a wall on America's southern border 'is an important immigration policy priority.'

Sixty-four per cent say state and local law enforcement should limit their cooperation with federal immigration officials.

Some of Brown's troops may be deployed this month and are expected to stay until at least Sept. 30, Brown said. They will be assigned to all parts of the state, not just the border.

Homeland Security Sec. Kirsten Nielsen appeared alongside Arizona Gov. Doug Ducey on Wednesday to thank him for contributing 440 troops.

Neilsen toured the border in Calexico, California on Wednesday as Republican governors in the three other border states had already sent Guard detachments to help

She said there are already 1,000 National Guardsmen and women deployed on Trump's border mission – that number is growing – and they're performing aerial surveillance and vehicle repairs.

Trump first lashed out at Brown on Tuesday, complaining on Twitter that the Democrat was forbidding his Guard detachment from doing its job.

'Looks like Jerry Brown and California are not looking for safety and security along their very porous Border. He cannot come to terms for the National Guard to patrol and protect the Border,' the president wrote.

'The high crime rate will only get higher. Much wanted Wall in San Diego already started!'

Soldiers from the Texas Army National Guard keep watch on the banks of the Rio Grande, where some of them will be armed where necessary

Talks between U.S. and California officials about the duties the California troops would perform soured last Friday and over the weekend after state authorities told federal officials that they would not participate in the jobs outlined for California, Arizona, New Mexico and Texas border control.

The other border-state governors – all Republicans – have openly embraced Trump's plans.

Brown hasn't explicitly outlined how he would distinguish between immigration-related work and going after criminal gangs and drug and gun smugglers.

He had originally elicited rare and effusive praise from the president last week after he said he would participate in the Guard's third large-scale border mission since 2006.

Trump believes that Brown wants a 'porous' border, but he will have National Guard troops from three other states helping to secure it while his long-promised wall is built

At the time, the decision allowed Trump to boast support from all four border-state governors and helped put the president above the lower end of his threshold of marshaling 2,000 to 4,000 troops that he wants as a border security mission to fight illegal immigration and drug trafficking.

California is at the forefront of what opponents call a 'resistance' to Trump's administration, with the heavily Democratic state suing the federal government over numerous issues, including the rollback of environmental regulations.

Several cities including Los Angeles are 'sanctuary cities' that require local law enforcement agencies not to tell federal agents about residents' legal status.

Attorney General Jeff Sessions has sued the state over three statutes that support cities and counties that refuse to hand over illegal immigrants to federal immigration authorities for prosecution or deportation.