Senate Majority Leader Mitch McConnell R-KY, speaks to the media at the U.S. Capitol after a tentative deal is set to avert a second partial government shutdown

Senate Majority Leader Mitch McConnell R-KY, speaks to the media at the U.S. Capitol after a tentative deal is set to avert a second partial government shutdown

Senate Majority Leader Mitch McConnell speaks to the media Tuesday at the U.S. Capitol after a tentative deal is set to avert a partial government.

President Donald Trump said he isn’t happy with the bipartisan agreement on border security intended to avert another government shutdown, and said he’s still considering declaring a national emergency to bypass Congress to get money for his proposed wall.

“I’m not happy about it. It’s not doing the trick,” Trump said during a cabinet meeting at the White House on Tuesday. But he added, “I don’t think you’re going to see a shutdown.” He said he’ll hold a meeting later in the day to consider the proposal.

The tentative pact reached Monday night provides $1.375 billion for 55 new miles of border fencing in Texas’s Rio Grande Valley area, according to congressional aides who spoke on condition of anonymity. That’s far short of the $5.7 billion Trump wants for a wall. But the agreement also rejects limits Democrats sought on detentions of immigrants apprehended in the U.S.

It still has to be written into legislation, pass both chambers of Congress and get Trump’s approval before Friday night to avoid a partial government shutdown.

The agreement was announced less than an hour before Trump took the stage in the border city of El Paso, Texas, at a political rally to rev up supporters. Trump told his audience that he’d heard a deal was reached but didn’t know the details.

He gave no indication whether he’d sign the legislation once it reaches his desk, though he again touted the need for a wall between the U.S. and Mexico.

“Just so you know, we’re building the wall anyway,” he said. “We’re setting the table, we’re doing whatever we have to do. The wall’s being built.”

The agreement on the remaining seven spending bills would keep government agencies open through the end of the fiscal year, including the Department of Homeland Security that oversees border protection.

It was a rare feat of bipartisan compromise that only 24 hours earlier had seemed out of reach. But the drawn-out struggle is sure to be revived in the next budget battle and continue into the 2020 campaigns for the White House and Congress.

Aides said Democrats dropped their demand for a cap on detention beds for immigrants detained within the U.S. Instead, the deal would set an average daily cap at 45,274 beds — less than the 49,057 now detained, two aides said. Democrats believe that will drop the number detained to 40,520 by Sept. 30.

But the aides said Trump would retain authority to expand the number of beds by transferring money from other security accounts. Trump could boost the number of beds as high as 58,500 with that authority — enough to respond to a surge in illegal immigration and arrests, one aide said.

When asked whether Trump will support the deal, Senate Appropriations Chairman Richard Shelby said, “We think so, we hope so.” He said the White House had given Republican negotiators wide latitude to reach a deal.

Also participating in Monday’s meetings were Rep. Nita Lowey, D-N.Y., Sen. Patrick Leahy, D-Vt., and Rep. Kay Granger, R-Texas.

“If the four of us couldn’t get it together, Congress never could,” said Leahy, the Senate Appropriations panel’s top Democrat.

Trump remains a wild card. The President has in the past reversed course without warning, as he did last December in rejecting a previous spending accord and triggering a 35-day shutdown.

Some of the president’s allies who helped convince him to hold out for wall funding last year panned the committee’s negotiation almost as soon as the details were made public. Two leaders of the conservative House Freedom Caucus, Jim Jordan of Ohio and Mark Meadows of North Carolina, called it a bad deal but stopped short of urging Trump to reject it.

“This conference agreement is hardly a serious attempt to secure our border or stop the flow of illegal immigration,” Meadows said. “It kicks the can down the road yet again, failing to address the critical priorities outlined by Border Patrol Chiefs.”

A key sticking point had been funding for detention beds for immigration enforcement, which Democrats wanted to limit as a way to in effect force Immigration and Customs Enforcement to put less of a priority on undocumented immigrants without criminal backgrounds.

One aide said the 55 new miles of border barrier would be double the amount of new miles provided in fiscal 2018 and nearly three times as much as would have been available if current funds had been extended through September.