WASHINGTON — Averting a shutdown with minutes to spare, Congress passed an emergency spending bill late Thursday morning that will keep the federal government fully funded through lunch.

"This is what bipartisanship looks like," said a senior member of the Appropriations Committee, signing the measure on the hood of a food truck. "The American people asked us to keep the lights on, and for the next hour and five minutes, that is exactly what we are going to do."

The 2,300-page bill, which lawmakers received at 11:52 a.m. and approved at 11:54 a.m., provides $41 billion to operate every federal agency until 1 p.m. Eastern, with a 15-minute grace period for anyone who orders soup. It also includes $6 million to study whether lunch could be extended, and a provision allowing the Pentagon to roll over any unspent appetizers.

Negotiations nearly collapsed twice, first over the length of lunch and then over whether lunch included dessert. The final compromise funds dessert "through the end of the fiscal cookie," a phrase that leaders of both parties praised and neither could define.

"Some of my colleagues wanted to fund the government through Friday," said one House member. "That's reckless. You can't just hand Washington an entire Friday. Who knows what they'd do with it."

Agencies spent the morning preparing for a possible 1:01 p.m. shutdown. The National Park Service said that if funding lapsed it would close every national park, "starting with the ones that have the nicest benches," while the IRS confirmed that tax collection is an essential service and would continue "through lunch, dinner and the heat death of the universe."

At press time, the government had shut down at 12:40 p.m. after the Senate went over budget on breadsticks.