Lawmakers reached a tentative deal on border-security funding Monday that they hope will avert another government shutdown.

It includes $1.375 billion to build a barrier at the southern US border — less than a quarter of the $5.7 billion Trump demanded in December, triggering the first shutdown.

A lead Republican negotiator said that lawmakers "hope" Trump would sign the bill and that the White House had been kept up-to-date. It would also need to pass both chambers of Congress.

Trump made it clear at a rally later on Monday that he wanted the full wall built.

Lawmakers negotiating a new border-security deal in a bid to avoid another government shutdown reached a tentative deal on Monday night.

Its provisions, however, fall far short of the $5.7 billion for a wall on the southern US border that President Donald Trump has repeatedly demanded.

The provisional deal would provide $1.375 billion for border fortifications, made from vertical steel slats, rather than a solid wall, sources familiar with the deal told the Associated Press and Politico.

This is 24.1% of the $5.7 billion that Trump said he wanted in December. Congress' refusal to approve that funding led to large parts of the federal government shutting down for a record 35 days.

The lower amount would allow for 55 miles of barriers to be built, both outlets reported. The White House had demanded 215 miles in December.

A demonstrator at a rally against the partial government shutdown in Washington on January 10. Carlos Barria/Reuters

Democrats also dropped a new demand for a cap on the number of people whom Immigration and Customs Enforcement could detain at once.

In exchange, Republicans agreed to reduce the number of beds in detention centers to 40,250 from 49,057.

Details of the agreement will not be officially released until later this week, the outlets said.

Read more: It could take 300 years for Joshua Tree National Park to recover from the government shutdown

Both parties say they are keen to avoid a repeat of the first shutdown, which left more than 800,000 federal workers without work or working without pay. US national parks were left with heavy damage, and organizations like the FBI warned that Americans were being put at risk.

Sen. Richard Shelby, a lead Republican border-funding negotiator, said lawmakers from both parties were motivated by their desire to keep the government open.

Trump at the rally in El Paso, Texas, on Monday. Joe Raedle/Getty Images

"With the government being shut down, the specter of another shutdown this close, what brought us back together, I thought tonight, was we didn’t want that to happen," he said, according to the Associated Press.

But he described the agreement reached between the 17 Democratic and Republican lawmakers as an "agreement in principle."

For the deal to work in time to prevent a shutdown, both the House and the Senate must approve it, and Trump must sign it by midnight on Friday.

Shelby said the White House had "been consulted all along." Asked whether Trump would support the deal, he said: "We certainly hope so."

Read more: FBI Director Christopher Wray slams government shutdown, says he's as angry as he's been 'in a long, long time'

Trump has repeatedly made it clear that he will only sign funding legislation that includes funding for a physical barrier along the US-Mexico border.

Shortly after the deal was reached, Trump led a rally in El Paso, Texas, where he made it clear that he wanted a full wall built.

"They said that progress is being made with this committee," Trump told the crowd, the Associated Press reported. "Just so you know, we're building the wall anyway."

Trump has previously threatened to declare a national emergency to secure funds for the wall, though he would most likely face legal challenges if he did so.

Trump could also sign this new spending bill while also signing an executive order aimed at moving additional federal money not approved by Congress to build the wall — a move the White House is preparing to take, according to Politico, which noted that that move would almost surely be met with court challenges as well.

Beto O'Rourke also held a rally in El Paso on Monday, where people gathered to protest Trump's proposed border wall. Christ Chavez/Getty Images

While Trump spoke, former Rep. Beto O'Rourke of Texas led a march and rally through El Paso, his hometown, opposing a new border wall.

O'Rourke, as well as local politicians and law-enforcement officials, have repeatedly challenged Trump's claims that a border wall is necessary, citing federal statistics as well as local experience.

Read more: Trump versus O'Rourke: Scenes from their dueling rallies in El Paso, Texas

"Here is one of the safest cities in the United States of America, safe not because of walls but in spite of walls," O'Rourke said at the rally.