President Trump put California on notice in a tweet on Wednesday that he wouldn’t complete his much-promised wall on its border until the entire barrier was erected – even though the state’s attorney general said the “medieval” structure has no place in the “21st century.”

“I have decided that sections of the Wall that California wants built NOW will not be built until the whole Wall is approved,” he tweeted. “Big victory yesterday with ruling from the courts that allows us to proceed. OUR COUNTRY MUST HAVE BORDER SECURITY!”

He referred to the Tuesday ruling by US District Judge Gonzalo Curiel, who he maligned as “biased” during the 2016 campaign for his Mexican heritage, that sided with the Department of Homeland Security in a legal challenge that paves the way for a section of the wall to be built on the California border.

But Trump’s remarks about not building that portion of the barrier seem to play right into the hands of California Attorney General Xavier Becerra, who brought the suit against DHS and has pledged to continue to challenge the Trump administration over immigration issues and the wall.

“We will evaluate all of our options and are prepared to do what is necessary to protect our people, our values, and our economy from federal overreach,” Becerra said on Tuesday. “A medieval wall along the U.S.-Mexico border simply does not belong in the 21st century.”

Last week, the president said he was considering pulling Immigration and Customs Enforcement agents from California as punishment for its “lousy management job” of enforcing immigration laws.

“You know what, I’m thinking about doing it,” Trump said during a meeting at the White House last Thursday. “We’re getting no help from the state of California. Frankly, if I pulled our people from California, you would have a crime nest like you’ve never seen in California. All I’d have to do is say ‘ICE, Border Patrol, leave California alone.'”

Trump lost the Golden State to Hillary Clinton in the 2016 election by 30 percentage points.

The tweets also show the president appears to have a newfound admiration for Curiel, whom he blasted as a “hater” during the campaign when the Indiana-born judge was presiding over a lawsuit against Trump University.

“I have a judge who is a hater of Donald Trump, a hater,” Trump said. “His name is Gonzalo Curiel and he is not doing the right thing.”

But Tuesday night, Trump was praising his “big legal win” after Curiel’s decision.

“Big legal win today. U.S. judge sided with the Trump Administration and rejected the attempt to stop the government from building a great Border Wall on the Southern Border. Now this important project can go forward!​” Trump wrote late Tuesday.​