Updated

President Obama has signed into law a six day budget agreement that Congress approved early Saturday morning. Technically, the government's spending authority lapsed for more than a dozen hours. Fox News has learned the short term spending bill was sent to the White House at 1:35 a.m., and the president signed it in the early afternoon.

Congressional leaders agreed late Friday to a budget deal that would keep the federal government running through the remainder of the fiscal year which ends in September, thus averting a government shutdown.

But the details of the 11th hour agreement, which will cut $38.5 billion from the federal budget, still have to be written into legislation. So in the early hours of Saturday morning, the House voted on a bridge continuing resolution that funds the government through Thursday night and that's the nugget Mr. Obama signed Saturday - the seventh short term funding bill so far, in the 2011 fiscal year.

After House Speaker John Boehner. R-Ohio, and Senate Majority Leader Harry Reid, D-Nev., announced the final budget agreement, President Obama acknowledged the leaders' "dedication."

"This agreement between Democrats and Republicans on behalf of all Americans is on a budget that invests on our future while making the largest annual spending cut in our history," Obama said shortly before midnight from the White House. According to senior administration officials, Mr. Obama called both men late Friday to thank them for their hard work, after having spoken four times during the day with Boehner and several times with Reid.

The president didn't appear on camera until late Friday after having made it clear to staff, senior administration officials say, that he wanted a "quiet" day at the White House, and for them to stay out of the limelight and let the process on Capitol Hill work.

Obama's aides say the process, albeit slow and down to the wire, shows divided government does work. White House officials note that every time the talks got bogged down, the president picked up the phone and reminded leaders neither the White House nor Capitol Hill should be playing politics, that the finish line is what mattered. To get there though, there were of course concessions. "Like any worthwhile compromise, both sides had to make tough decisions and give ground on issues that were important to them," said Obama. "And I certainly did that."

Over the course of the debate, Democrats, who originally offered no cuts, then $4 billion, then $6.5 billion, then $33 billion, eventually settled on the $38.5 billion.

"Some of the cuts we agreed to will be painful. Programs people rely on will be cut back. Needed infrastructure projects will be delayed. And I would not have made these cuts in better circumstances, " Obama said from the Blue Room.

House Republicans were also able to get Senate Democrats to agree to straight up-or-down votes to defund the health care reform law and groups like the nation's largest abortion provider Planned Parenthood. While both votes are expected to fail, they are still concessions, albeit it hallow, as Majority Leader Reid once said he'd never allow them to come to the floor.

But senior administration officials say the composition of the cuts was more important than the actual number, a point the president addressed Friday. "We also made sure that at the end of the day, this was a debate about spending cuts, not social issues like women's health and the protection of our air and water," said Obama. "These are important issues that deserve discussion, just not during a debate about our budget."

Senior administration officials say the discussions with Speaker Boehner were always "good" and "honest" and that Boehner did not want a shutdown, so on the issue of family planning, "They were faced with a choice. Either give in or we'll shut down the government over it. They chose not to shut down the government over it."

White House officials refuse to pick a winner or loser in the budget debate, though many analysts say Boehner and the Republicans came out ahead. Mr. Obama's aides had said all along his proposed budget cuts were closer to what Republicans wanted than they were to his failed 2011 budget, which was the starting point. They are hopeful the good will can be built upon, as Capitol Hill prepares to take on tough battles like raising the debt ceiling.

"It's my sincere hope that we can continue to come together as we face the many difficult challenges that lie ahead - from creating jobs and growing our economy to educating our children and reducing our long-term deficits," said Obama in his weekly address Saturday.

Kelly Chernenkoff and Wendell Goler contributed to this report