WASHINGTON (Reuters) - Efforts in the U.S. Congress to resolve an impasse over border security funding intensified on Friday and were expected to continue over the weekend, as a special negotiating panel aimed to come to a deal by Monday, lawmakers and aides said.

FILE PHOTO: A prototype for U.S. President Donald Trump's border wall is seen through the border fence between Mexico and the United States, in Tijuana, Mexico January 7, 2019. REUTERS/Jorge Duenes/File Photo

Despite optimism among Senate and House of Representatives negotiators, contingency plans also were being made in case the talks falter.

Rather than push the Department of Homeland Security and several other federal agencies into a second partial shutdown when their funding expires on Feb. 15, the group of 17 lawmakers were preparing a stop-gap appropriations bill to keep them operating beyond that date.

That would allow more time if necessary to haggle over President Donald Trump’s demand for $5.7 billion this year to help construct a U.S.-Mexico border wall.

Democratic Representative Nita Lowey, a lead negotiator, told Reuters in a brief hallway interview that the bipartisan panel was “working together. I’m always optimistic.” But she added, “It will probably take a little longer” than this weekend to reach agreement.

House Minority Leader Kevin McCarthy, a Republican, complained that while Democrats “talk about more money for a barrier,” they also were trying to place restrictions on how that money would be used.

Trump says a border wall is needed to block the entry of illegal drugs and undocumented immigrants. Democrats counter that at an overall wall cost of $25 billion or more, high-tech tools, such as drones, scanners and sensors would be more cost-effective and could be deployed immediately.

Republicans and Democrats in the past 24 hours swapped a series of proposals, lawmakers said. The main sticking points still had not been resolved.

“There’s multiple offers back and forth ... Democrats submitted a counter-offer last night,” said Democratic Representative Pete Aguilar, another negotiator.

The two parties continued to argue over how much money should be appropriated for the rest of this fiscal year, which ends on Sept. 30, for barriers such as steel-slatted fencing.

A Republican negotiator, Representative Chuck Fleischmann, told reporters a deal could contain more than the $1.6 billion that the Senate had approved in December but substantially less than Trump’s $5.7 billion demand.

Asked about the $1.6 billion figure, Fleischmann said, “I hope it’s north of that. I wouldn’t necessarily say far north.”

Another contentious issue, lawmakers said, was Democrats’ demands for funding fewer immigrant detention beds than the Trump administration seeks. Republicans want to increase the number as part of their drive to speed immigrant deportations.

Meanwhile, according to one official familiar with the talks, Democratic Representative Henry Cuellar pushed for prohibiting border-barrier construction around some environmentally fragile areas, national parks and a SpaceX launch facility in his home state of Texas.

Even if a border security deal is reached, sparing the country another shutdown that left 800,000 federal workers without paychecks for more than a month, the border wall battle between Trump and Democrats will resume. In coming weeks, Congress will begin writing fiscal 2020 appropriations bills.

Trump’s budget director, Mick Mulvaney, has invited a few of the negotiators from both parties, as well as a handful of other House members, this weekend to discuss bipartisanship now that Democrats have wrested control of that chamber from Republicans.

They are scheduled to gather at Camp David, the presidential retreat in Maryland, Friday night and Saturday morning.