President Donald Trump hasn’t decided whether to support the bipartisan congressional agreement on border security that requires him to accept less wall construction money than he demanded as a way to avert another government shutdown, an administration official said.

It’s “very difficult” to comment “until we actually see the language,” White House spokesman Hogan Gidley said Tuesday on Fox News. “We don’t know what’s in it at this time.”

Senate Majority Leader Mitch McConnell of Kentucky called the deal “certainly good news,” saying it “provides new funds for miles of new border barriers.” He said he’ll review the bill text and hopes the Senate will vote on it “in short order.” Senate Minority Leader Chuck Schumer of New York urged Trump to sign the measure, saying, “These months of shutdown politics must come to an end.”

The tentative pact reached Monday night provides $1.375 billion for 55 new miles (88.5 kilometers) 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.

Stocks in the U.S. rose in part on the prospects of the deal, which removed some uncertainty about a government shutdown, as well as hints the U.S. and China will reach agreement on trade. The S&P 500 Index, the Dow Jones Industrial Average and the Nasdaq 100 all advanced.

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.”

Drawn Out

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 Representative Nita Lowey of New York and Senator Patrick Leahy of Vermont, both Democrats, and Representative Kay Granger, a Texas Republican.

“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. The Border Patrol could use any design in current use, including steel slats, but not a purely concrete wall some of Trump’s supporters have cheered.

Lowey, the House Appropriations chairwoman, said congressional staff will put together the details of the agreement. Votes would need to be taken before Friday night, when funding expires for the government agencies.

“I hope by Wednesday we’ll have a finished product,” Lowey said. “Some people may think it’s a great deal, some people may have done it differently, but we did it together and I really think it’s a good product.”

House Democrats opened the talks with an offer of no new money for border barriers, while Senate Democrats had offered $1.6 billion in funds before the shutdown began.

Trump has been demanding a wall since the 2016 presidential campaign. The recent shutdown, the nation’s longest, ended when he signed a three-week spending bill on Jan. 25 and both parties agreed to create a 17-member committee to negotiate a solution.

U.S. House Speaker Nancy Pelosi, a California Democrat, has said she would accept whatever accord the group came up with, and Lowey said she had signed off on the deal. If Trump doesn’t go along, however, some GOP senators say they’re unlikely to support it, McConnell, a Kentucky Republican, hasn’t ruled out bringing it to a vote.

Trump has threatened another shutdown if a new spending bill doesn’t fund “a new physical barrier, or wall” along the border. The president has a history of tearing up bipartisan agreements, including a potential one last year that would have provided $25 billion in wall money in exchange for protection from deportation for young undocumented immigrants.

The president has said he may declare an emergency and use money from other parts of the budget to fund a wall. Such a move would likely be challenged in court, and Pelosi could force votes in Congress on whether to disapprove the emergency declaration. McConnell, who has urged Trump to avoid declaring an emergency, has sought to protect his senators from a vote on it.

One Senate GOP leader, Roy Blunt of Missouri, said he’s examining ways Trump could tap federal funds funds for wall construction without an emergency declaration.

“There are a handful of those places, and if we get to the place where it’s time to talk to the president about those I intend to,” Blunt said. As an example, Blunt pointed to a Drug Corridors program enacted last summer that’s never been put in place and that has $800 million allotted to it. Other funds might be shifted from existing programs, he said.

Republicans have described the new barrier funded by the bill as a “wall,” while Democrats prefer the term “fence.” The semantic distinction could allow both sides to claim victory, with Republicans arguing they met Trump’s campaign promise of a southern border wall, and Democrats saying there is no money for a wall.

The deal would allow a number of departments to continue operating, including Agriculture, Commerce, Interior, Justice, State, Transportation, Treasury, and Housing and Urban Development. The Food and Drug Administration and Environmental Protection Agency would also be funded.

If the agreement is enacted, it could set a more positive tone for the newly divided Congress that took office during the shutdown in January.

Congress will need to raise the nation’s debt ceiling later this year, and decide what to do about $126 billion in automatic cuts to defense and non-defense discretionary funding caps set for 2020. Trump also will ask Democrats approve a revised North American Free Trade Agreement, and the president and Democrats say they want to develop an infrastructure plan.