WASHINGTON, Mar. 8 (Reuters) - The U.S. Senate narrowly averted a partial government shutdown on Friday, as the chamber approved spending legislation for several government agencies just hours before current funding was due to expire.

By a bipartisan vote of 75-22, the Senate approved a $467.5 billion spending package that will fund agriculture, transportation, housing, energy, veterans and other programs through the end of the fiscal year on Sept. 30. The package now heads to Democratic President Joe Biden to sign into law.

The vote partially resolves a bitter, months-long battle over government spending that at one point left the Republican-controlled House of Representatives leaderless for three weeks.

"To folks who worry that divided government means nothing ever gets done, this bipartisan package says otherwise," Senate Democratic Leader Chuck Schumer said ahead of the vote.

The package easily passed the Republican-controlled House of Representatives earlier this week. But action in the Senate was delayed as some conservative Republicans pressed for votes on immigration and other topics. They all failed.

Congress must still work out a deal on a much larger package of spending bills, covering the military, homeland security, health care and other services. Funding for those programs expires on March 22.

Taken together, the two packages would cost $1.66 trillion. Far-right Republicans had pushed for deeper spending cuts to tame a $34.5 trillion national debt.

All these measures were supposed to have been enacted into law by last Oct. 1, the start of the 2024 fiscal year. While Congress rarely meets that deadline, the debate this year has been unusually chaotic. Congress so far has had to approve four temporary funding bills to keep agency operations limping along at their previous year's levels.

The spending bills include $241.3 million in earmarks - local projects secured by individual lawmakers - requested by Democratic Senator Dianne Feinstein. She died on September 29, 2023, two days before the start of the fiscal year.

Photo from Reuters