U.S. House and Senate negotiators said Monday night that they have reached "an agreement in principle" on spending and border security in a bid to avoid another government shutdown.

"We've had a good evening. We've reached an agreement in principle," Republican Senator Richard Shelby, chair of the Senate Appropriations Committee, told reporters.

"The White House has been consulted all along," he said.

Democratic Representative Nita Lowey said she hopes for legislation to be released on Wednesday.

The emerging deal, whose details are still being finalized, would fund a number of federal departments and agencies, including the Department of Homeland Security in charge of border security.

It was not immediately clear if and how much Democratic lawmakers would agree to fund the border wall, a signature campaign promise of President Donald Trump.

A temporary funding bill runs out Friday. Both the House and Senate will have to approve the legislation and Trump must sign it so as to avoid another government shutdown.

Trump has requested 5.7 billion U.S. dollars for building a wall along the U.S.-Mexico border, arguing it is essential to beefing up border security and curbing crime.

Democrats have rejected the idea of a border wall, slamming it as expensive, ineffective and "immoral," and called the proposal Trump's "political theater" to fire up his base, while they prefer the use of technology like drones and sensors in strengthening border security.

The confrontation over border wall funds caused a record-breaking 35-day partial government shutdown, which ended in late January when Trump agreed to fund the government for three weeks to allow for negotiations.