WASHINGTON — Democrats and Republicans forged agreement early Wednesday on a spending package that will fund the government for the next eight months, as well as provide billions in emergency funding for COVID-19 and the war in Ukraine.

The announcement means Congress should be able to avert a government shutdown when a spending patch expires at midnight on Friday, though an additional patch until next week will have to be passed as well.

The $1.5 trillion government funding section of the bill includes the first round of earmarks in more than a decade, allowing members from both political parties to secure federal dollars for home-state projects.

The overhauled program, now referred to as congressionally directed spending or community project funding, was brought back less than a year ago with members of both political parties requesting millions for projects ranging from addiction treatment programs to bridge repairs to agriculture programs.

The new earmarks include more guardrails and oversight mechanisms than lawmakers had in place before House Republicans and Senate Democrats banned the former practice in 2011 following years of scandal.

For example, funding cannot go to for-profit entities and the Government Accountability Office will audit the process annually. The total amount of spending on earmarks is now capped at 1%.

In addition to funding for the whole of the federal government, the measure includes $13.6 billion for military and humanitarian assistance in Ukraine amid the Russian war and $15 billion in pandemic assistance for testing, therapeutics and vaccines.

The $1.5 trillion government funding section of the package provides $782 billion, or a 6% increase, for defense and $730 billion, or a 6.7% increase, for domestic and foreign aid programs for the fiscal year that began on Oct. 1.

The U.S. House is expected to vote on the 2,741-page measure Wednesday to send it to the Senate. President Joe Biden is expected to sign the measure into law once it reaches his desk.

But lawmakers will also vote on a stopgap spending bill to keep the government running through March 15 to give the Senate enough time to hold votes on the package.

Senate Minority Leader Mitch McConnell said in a statement that he would be encouraging his colleagues to vote for the bill.

“The bipartisan product contains major wins for our national defense, for our friends in Ukraine, for the conscience rights of the American people, and for many other key priorities, and it keeps new left-wing poison pills out,” the Kentucky Republican said in a statement.

Acting White House Budget Director Shalanda Young said: “The bipartisan funding bill is proof that both parties can come together to deliver for the American people and advance critical national priorities.”

Hyde amendment

GOP lawmakers were able to keep the nearly 50-year-old Hyde amendment in the spending package after Democrats removed it from the original batch of House and Senate appropriations bills.

The provision, as well as several others like it, bars the federal government from spending money on abortion with limited exceptions.

Progressive Democrats have long sought to remove the funding prohibitions from the annual government funding measures, but this was the first fiscal year Democratic party leaders did so.

Republicans said they wouldn’t agree to any funding measure that didn’t include the spending restriction, leading to it being added back into the final version of the bills Congress is set to pass in the coming days.

House Appropriations Chair Rosa DeLauro, a Connecticut Democrat, said in a statement that the spending measure “delivers transformative federal investments to help lower the cost of living for working families, create American jobs, and provide a lifeline for the vulnerable.”

The federal spending section of the bill has been in the works for months, though both political parties reached agreement on a “framework” for the deal just last month.

Aid for Ukraine

Negotiations over assistance for Ukraine and the pandemic began a little over a week ago when the Biden administration told Congress that Ukraine needed about $6.4 billion in assistance. As Russia continued to bomb the country, killing civilians and sending more than 2 million people fleeing to Europe as refugees, the White House increased the request to $10 billion.  Biden also asked Congress to include $22.5 billion in COVID-19 aid.

The government spending bill wraps up the dozen annual government spending bills that fund federal departments and agencies. The package is supposed to pass before the start of the fiscal year on Oct. 1, but Congress rarely reaches agreement by the deadline.

This year, lawmakers used three stopgap spending bills to keep money flowing at levels last agreed to during the Trump administration before coming to agreement this week.

The White House said in a Statement of Administration Policy that it supported the package, in part, because it “would end a damaging series of short-term continuing resolutions that for months have undermined the Government’s ability to meet pressing challenges and would provide critical resources to invest in American workers and families and advance American leadership abroad.”

The funding packages, which generally get broad bipartisan support, also carry several additional bills with them.

This year that includes a reauthorization of the Violence Against Women Act, which hasn’t been authorized since lawmakers allowed it to expire in December 2018.

“The expiration of VAWA three years ago put many lives in jeopardy,” Senate Majority Leader Chuck Schumer said in a statement. “It is such good news that it is finally being reauthorized.”