WASHINGTON - A spending measure passed by the House on Wednesday to keep the government operating through September requires that the Postal Service maintain a six-day mail delivery schedule, a potential setback for the agency, which announced last month that it planned go to five-day deliveries to cut costs.

The legislation passed the House 267 to 151, with 137 Democrats voting against it. The measure now moves to the Senate.

Faced with billions of dollars in losses, Postal Service officials said last month that beginning in August the service would stop delivering mail on Saturdays, though it would continue to deliver packages on a six-day schedule. The agency said cutting Saturday delivery would save about $2 billion a year.

The agency lost about $15.9 billion last year, partly the a result of a 2006 law requiring it to pay about $5.5 billion into a health benefits fund for its future retirees. A drop in mail volume has also hurt the agency’s finances.