Congressional leaders have reached a deal to avert a government shutdown next week, landing on a two-step stopgap bill that will keep the lights on in Washington into March, according to two sources familiar.

Under the deal, the new government funding deadlines will be March 1 and March 7. The agreement comes ahead of Friday’s shutdown deadline, and a second deadline on Feb. 2.

The deal — which still needs to be approved by both chambers next week — will give the House and Senate more time to complete work on the 12 appropriations bills. Congressional leaders announced a deal on top-line spending numbers last weekend, but appropriators need more time to hash out particulars in each funding bill.