WASHINGTON (Reuters) - President Donald Trump said on Tuesday he was unhappy with a deal struck by congressional negotiators on border security that denied him funds for his promised U.S.-Mexican border wall, but did not reject it outright as fellow Republicans urged his support.

Trump’s demand in December for $5.7 billion from Congress to help build a wall on the southern border triggered a 35-day closure of about a quarter of the federal government. But he remains undecided about whether he will support the agreement reached on Monday night that includes $1.37 billion for border fencing.

Nevertheless, Trump said he did not expect another shutdown, while continuing to insist he could find a way to bypass Congress and build a wall without lawmakers.

Trump posted on Twitter that he had been briefed by Republican Senator Richard Shelby and was reviewing the measure.

The Republican president repeated his insistence that if Congress did not provide the funding, he would press forward with building a wall, writing: “Regardless of Wall money, it is being built as we speak!”

White House aides are considering having Trump sign the compromise deal but also try to move money that has already been allocated for other programs to instead build the wall, one official said. Trump may need approval from Democrats in the House to be able to do so.

Funding for the Department of Homeland Security, the Justice Department and a host of other agencies is due to end on Saturday after the expiration of a stopgap measure that ended the longest federal shutdown in U.S. history. Monday’s tentative funding agreement would keep the government open until Sept. 30, the end of the federal fiscal year.

“I have to study it. I’m not happy about it,” Trump told reporters at the White House about the deal, which would need to be passed by the Democratic-led House of Representatives and Republican-controlled Senate and signed by him.

The House could vote late on Wednesday at the earliest, according to a senior aide. Congress must pass the measure by Friday’s midnight deadline.

Congressional Republicans have shown little appetite for another shutdown after taking heavy criticism over the prior one. “I hope he’ll decide to sign it,” Senate Majority Leader Mitch McConnell told reporters. House Republican leader Kevin McCarthy also touted the deal.

But the most conservative members of the House are unhappy with the deal, a sign it could face trouble if some liberal Democrats also defect over border fencing funding and concerns about the number of beds in immigrant detention facilities.

“Most conservative members are having real heartburn today,” Republican Representative Mark Meadows said on Fox News. “I can tell you it’s the Democrats that are walking around here on Capitol Hill with a smile on their face today, not Republicans.”

‘WE’RE BUILDING THE WALL’

Slideshow ( 8 images )

Congressional sources said the agreement includes $1.37 billion for new fencing - about the same as last year - along 55 miles (90 km) of the border but only with currently used designs such as “steel bollard” fencing. It also addresses capacity at immigration detention facilities, specifically the number of beds for people awaiting possible deportation.

Trump previously threatened to declare a “national emergency” if Congress did not provide money specifically for the wall, an action under which he might redirect other funds already provided by Congress to pay for wall construction. Fellow Republicans have told Trump such a step would almost certainly draw opposition, both in Congress and in the courts.

On Tuesday, Trump signaled possible unilateral action.

Slideshow ( 8 images )

“The bottom is on the wall: We’re building the wall,” Trump said, adding: “We’re supplementing things, and moving things around, and we’re doing things that are fantastic and taking, really, from far-less-important areas.”

Republican James Inhofe, who heads the Senate Armed Services Committee, told reporters that he urged Trump weeks ago not to raid Pentagon accounts to build a wall. Inhofe indicated Trump could try to use Army Corps of Engineers funds.

Trump made the wall a central 2016 campaign promise, calling it necessary to combat illegal immigration and drug trafficking. He said Mexico would pay for it, but Mexican officials rejected that. Democrats have called a wall expensive, ineffective and immoral.

McConnell, who had counseled Trump against the previous shutdown, said Democrats had abandoned “unreasonable” demands. McCarthy told CNBC that Democrats had caved by allowing the new border fencing. The border barrier funding was far short, however, of the $5.7 billion in wall money Trump wanted and was less than Trump could have had in compromise legislation passed in December by the Senate.

Senior Democrats threw their weight behind the deal and said both sides gave ground. Top Senate Democrat Chuck Schumer said: “I strongly urge the president to sign this.”

Trump retreated last month when he agreed to end the shutdown without getting wall money. The shutdown roiled financial markets and left hundreds of thousands of federal workers and contractors without pay.

Democrats oppose the wall, but support border security efforts. The number of beds in detention facilities was a contentious part of the negotiations because it can either constrain or expand the administration’s ability to aggressively deport more immigrants, including those seeking asylum.

Congressional aides on Tuesday gave differing accounts on the number of beds the deal permitted, with some saying it would drop to 40,520 by later this year and others saying it could rise to 58,500. Democrats had sought to limit the number.