(CNN) Top congressional negotiators clinched a "deal in principle" to fund the US government, an agreement that comes a little more than a week before the deadline and likely takes the threat of a government shutdown off the table.

The bipartisan foursome of the top appropriators reached the agreement after meeting in the Capitol on Thursday, capping a day of harried negotiations, proposals and counter proposals that will significantly curtail the threat of a government shutdown. Staff will work through the weekend to produce the final legislation, which will likely move in two separate packages that receive House floor votes on Tuesday, according to an aide.

The $1.37 trillion agreement includes all 12 spending bills and came after a day of last-minute negotiations and shuttle diplomacy between Senate Appropriations Committee Chairman Richard Shelby, an Alabama Republican, and his House counterpart Nita Lowey, a New York Democrat, along with the two ranking members on their committees, Sen. Patrick Leahy, a Democrat of Vermont, and Rep. Kay Granger, a Texas Republican. At various points meetings included House Speaker Nancy Pelosi, Senate Majority Leader Mitch McConnell and Treasury Secretary Steve Mnuchin, the Trump administration's point person on the negotiations.

It also came as time was running out to reach an agreement that could be moved through both the House and Senate before the December 20 funding deadline. President Donald Trump will also have to sign the measure into law and has yet to weigh in publicly, but Mnuchin and Eric Ueland, the White House director of legislative affairs, were regularly apprised, and often present, during some of the final stages of the negotiations.

The tentative agreement still left some issues to ironed out over the course of the weekend, aides said, but the topline agreement and momentum to move forward before lawmakers leave town for the Christmas holiday creates a momentum that generally carries final negotiations across the finish line.

Read More