(Updates with House plans)
WASHINGTON, March 23 (Reuters) - U.S. President Donald Trump made a surprising threat on Friday to veto Congress' newly passed $1.3 trillion spending bill, a move that raised the specter of a government shutdown ahead of a midnight deadline to renew funding for federal agencies.
In a tweet on Friday morning Trump said he was displeased about immigration issues in the bill, even though the White House had given assurances on Thursday that he would sign it.
At the White House on Friday, many aides were caught by surprise by the veto threat and had no immediate explanation for what prompted it. Trump was scheduled on Friday to fly to Florida for a weekend at his private resort.
After passing the measure, lawmakers in the Senate and House of Representatives, which both are dominated by Trump's fellow Republicans, left Washington for a scheduled two-week spring recess.
A senior House aide said there were no plans to call lawmakers back for a special session, all but guaranteeing there would be a shutdown unless Trump backed down from his threat.
"I am considering a VETO of the Omnibus Spending Bill based on the fact that the 800,000 plus DACA recipients have been totally abandoned by the Democrats (not even mentioned in Bill) and the BORDER WALL, which is desperately needed for our National Defense, is not fully funded," Trump wrote.
Neither Speaker Paul Ryan nor Senate Leader Mitch McConnell commented publicly on Trump's tweet.
"The government will only shut down if President Trump vetoes this bipartisan bill," Democratic Senator Chris van Hollen said in an interview on MSNBC. "No one's being fooled by the president's claim."
The threat marks the third consecutive month of government funding snafus. In January, the government shut down for three days as lawmakers fought over immigration. In February, there was an hourslong shutdown when a Republican lawmaker delayed a funding bill to protest a hike in the U.S. deficit.
CAUGHT BY SURPRISE
White House spokeswoman Sarah Sanders was expected to face questions about the veto threat at a briefing scheduled for 1 p.m. EDT (1700 GMT).
Trump has been frustrated that Congress has not turned over funding to make good on his campaign promise to build a wall along the U.S.-Mexico border. The bill includes $1.6 billion for six month's of work on the project, although he had sought $25 billion for it.
Trump also has been at odds with Democrats in Congress over the fate of Dreamer immigrants - those brought to the United States illegally when they were children.
In a hastily arranged news conference on Thursday, Trump's budget director and top legislative aide had insisted he would sign the bill and tried to cast the budget as a downpayment on Trump's wall pledge.
"It does a lot of what we wanted - not everything we wanted - but a lot of what we wanted on immigration," White House budget director Mick Mulvaney told reporters.
As the six-month spending deal was coming together, there had been reports Trump had balked at the deal and had to be persuaded by Republican Speaker Paul Ryan to support it.
Only minutes before Trump's threat, Ryan had tweeted: "Our men and women in uniform have earned a pay raise. Thats why yesterday, we voted to provide the biggest pay raise for our troops in 8 years."
Senator John Cornyn, the No. 2 Republican in the Senate, tweeted at Trump that the bill had "benefits" for "national security, border security, opioid crisis, infrastructure, school safety and fixing gun background check system" - all policies that Trump supports.
But the Conservative wing of Trump's party had panned the bill because of its spending increases. On Friday morning, Pete Hegseth, a Fox News host who Trump admires, said on the channel's morning show that it was a "swamp budget" and a "Mitch McConnell special," casting the budget as a win for Democrats.
Some deficit hawks cheered Trump's threat to veto it.
"Please do, Mr. President," Republican Senator Bob Corker said on Twitter. "I am just down the street and will bring you a pen. The spending levels without any offsets are grotesque, throwing all of our children under the bus."
If Trump forces Congress to renegotiate a deal, he is likely to get one that is even less favorable on his priorities, said one Democratic aide.
Democratic lawmakers said Trump created his own crisis by canceling the Deferred Action for Childhood Arrivals (DACA) program that gives work permits to certain young immigrants and protects them from deportation. The decision is currently tied up in court cases.
"NOW you care about the Dreamers Mr. President?" Democratic Representative Jan Schakowsky said on Twitter. "Six months after throwing their lives into chaos? Is this a cruel joke?" (Reporting by Richard Cowan and Steve Holland; additional reporting by Roberta Rampton, Amanda Becker, Susan Heavey and Patricia Zengerle; Editing by Bill Trott)