WASHINGTON — With only hours to spare on the last day of the fiscal year, Congress averted a government shutdown on Wednesday by approving a temporary spending measure to keep federal agencies operating through Dec. 11.

In the House, the legislation was approved only because of strong support by Democrats — a sign of how angry rank-and-file Republicans remain over their powerlessness to force policy changes on the Obama administration.

The House vote was 257 to 151, with 186 Democrats and 91 Republicans in favor. All of the “no” votes were by Republicans.

In one last display of their fury, House Republicans on Wednesday adopted another resolution to cut off government financing to Planned Parenthood. The resolution was to be sent to the Senate, where Democrats were certain to block it.