WASHINGTON (AP) -- The House has approved legislation to prevent a government shutdown at the end of the month and give the Pentagon some relief from a cash crunch that's harming military readiness.

The huge spending measure, which was passed on a 267-151 vote, would fund federal operations through September. It leaves in place automatic cuts of 5 percent to domestic agencies and 7.8 percent to the Pentagon ordered by President Barack Obama Friday night after months of battling Republicans over the budget.

Republicans muscled the measure through on a mostly party-line vote over objections from Democrats protesting those across-the-board spending cuts.

The stopgap measure would provide budget relief for military readiness, veterans' health programs, embassy security and the FBI, but would put most of the rest of the government on budget autopilot.

Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.