Negotiators say they have worked out disagreements on border spending, but they still have to win over Trump.

Congressional negotiators announced Monday evening they had agreed to the broad outlines of a deal to avoid a partial government shutdown later this week, saying they hoped to draft the measure and move it through both chambers quickly.

The breakthrough came as the top appropriators in the House and Senate, Sens. Richard Shelby, R-Ala., and Patrick Leahy, D-Vt., and Reps. Nita Lowey, D-N.Y., and Kay Granger, R-Texas, met several times throughout the night to resolve divisions over border security issues. A current stopgap bill that provided funding to the agencies that have yet to receive full-year appropriations is set to expire Friday evening.

The lawmakers did not disclose the details of the agreement and Shelby said the deal was “in principle.” Staffers are now set to finalize the plan through legislative text, which will set funding levels for the Homeland Security Department and the agencies funded through the six additional outstanding spending bills. The measure to reopen government after the recent 35-day shutdown included a provision that created a bicameral conference committee to resolve the standoff over border security and immigration issues, including President Trump’s demand for “physical barriers” along the U.S.-Mexico border.

In recent days, negotiators sounded pessimistic on the likelihood of an agreement and the White House said a shutdown was still on the table. Democrats appeared to cede some funds for new border barriers, but demanded a cap on the number of immigrants Immigration and Customs Enforcement can detain. Republicans and Trump quickly derided that request.

The lawmakers on Monday evening did not disclose whether they had briefed Trump on their package or if he would sign off on the bill.

The departments of Transportation, Housing and Urban Development, State, Interior, Agriculture, Treasury, Commerce, Homeland Security and Justice, as well as the Environmental Protection Agency, NASA, Office of Personnel Management and other independent agencies, have yet to receive full-year appropriations and would again shut down absent congressional action.