Lawmakers tentatively reached a last-minute deal Tuesday night to avert a government shutdown on Saturday, according to news reports.

House leadership has agreed on a plan to include funding to deal with the water crisis in Flint, Mich., in the 2016 Water Resources Development Act, the Washington Post and The Hill reported. The Flint funding, which is in the Senate version but not the House version of the waterways bill, became the major sticking point in negotiations over a continuing resolution to keep the government open past Sept. 30 into the start of fiscal 2017. Most Senate Democrats opposed the CR that Majority Leader Mitch McConnell, R-Ky., put forward because it didn’t include funding for Flint. The CR does include aid for communities devastated by recent floods in Louisiana and elsewhere.

The House will vote on an amendment Wednesday to its water projects bill that includes $170 million for Flint and other communities with contaminated water, paving the way for the Senate to finally pass the CR. On Tuesday, the CR failed on two votes to advance in the Senate because Democrats and some Republicans blocked it. If it passes the Senate, the stopgap spending measure, which funds the government through Dec. 9, heads to the House, where lawmakers have to vote on it before the end of the day on Friday.

Senate Democrats wanted to include the Flint money in the CR because it’s considered must-pass legislation. Senate Republicans said they would get it into the House waterways bill eventually during conference over that legislation, but Democrats were skeptical, so they forced the debate into CR negotiations.

McConnell said on Tuesday that the Senate would vote in the early afternoon again Wednesday on the CR.