Washington (CNN) -- President Barack Obama signed a short-term funding extension on Saturday hours after Democrats and Republicans narrowly averted a partial shutdown of the federal government by agreeing on the measure and a budget deal.
The new funding extension, which cuts spending by $2 billion, will last through next Friday, April 15.
The Senate immediately passed the extension on a voice vote. The House of Representatives followed suit early Saturday morning.
Administration and congressional officials made clear that there would be no lapses in government funding.
In his weekly address Saturday, the president explained that the agreement meant that small businesses can get the loans they need, families can get the mortgages they applied for, "folks can visit our national parks and museums" and paychecks, including those for the military, will be delivered on time.
"This is an agreement to invest in our country's future while making the largest annual spending cut in our history," Obama said.
The president later made an announced visit to the Lincoln Memorial, where he shook hands and sprinted down its steps.
"I just want to say real quick that because Congress was able to settle its differences -- that's why this place is open today and everybody's able to enjoy their visit," Obama said. "That's the kind of future cooperation I hope we have going forward."
Negotiators capped days of frantic closed-door talks and public recriminations by agreeing on a framework for a package of $38.5 billion in spending cuts covering the rest of the fiscal year, which expires September 30. The budget deal still needs to pass in both houses, with the expectation that lawmakers will approve it and the president will sign it before the short-term funding measure expires.
The House is scheduled to begin considering that budget deal on Monday, with a vote slated for Wednesday. The Senate would take up the bill at some point after that, said spokesman Jon Summers of Senate Majority Leader Harry Reid's office.
Republicans, bolstered by their capture of the House of Representatives in last November's midterm elections, had initially pushed for $61 billion in cuts.
A GOP push to strip $317 million in federal funding from Planned Parenthood failed. Democrats also turned back Republican attempts to get federal dollars currently set aside for family planning and women's health turned into block grants for states.
Such a move would have given governors and state legislatures more ability to cut funding for services opposed by conservatives.
Sources told CNN, however, that leaders of the Democratic-controlled Senate agreed to hold separate votes on both measures, as well as on an initiative to repeal Obama's health care overhaul.
Obama praised the agreement, calling the cuts "painful" but necessary to secure the country's economic future.
This "is what the American people expect us to do," the president said at the White House. "That's why they sent us here."
He also praised the deal as a model of bipartisan cooperation.
"Like any worthwhile compromise, both sides had to make tough decisions and give ground on issues that were important to them," he said.
"This has been a lot of discussion and a long fight," said House Speaker John Boehner, R-Ohio. Republicans fought to "create a better environment for job creators in our country."
Senate Majority Leader Harry Reid, D-Nevada, called the deal "difficult but important for the country."
Nevertheless, the furious down-to-the-wire talks portend even tougher rounds of negotiations when Congress takes up an increase in the nation's debt ceiling and the fiscal year 2012 budget in the months ahead.
Former House Speaker Newt Gingrich echoed that thought Saturday. In 1995, Gingrich and Republicans controlling the Senate clashed with President Bill Clinton over the federal government, forcing a shutdown.
"It's the first big step in the right direction," said Gingrich, a possible Republican presidential candidate, of Friday night's legislation. "John Boehner got the largest spending cut in history."
If the negotiations had failed, approximately 800,000 government workers would have been furloughed. A range of government services would have come to halt.
Obama noted earlier in the week that the mechanism of shutting down government operations had already started. An inability to reach a deal would have hurt federal workers, people who rely on government services and the nation's broader economic recovery, he warned.
"For us to go backwards because Washington couldn't get its act together is unacceptable," the president said.
Top aides on both sides of the aisle had seemed increasingly resigned to the prospect of a shutdown. Congressional staffers began receiving their furlough notices Thursday afternoon.
Friday's agreement to slash $38.5 billion in spending comes on top of two previous funding extensions that included $10 billion in cuts.
Republicans, under pressure from the conservative Tea Party movement to reduce the size of government, blame Democrats for failing to pass a fiscal year 2011 budget last year when they controlled both the Senate and the House. They also say Obama and his party are ignoring the peril of rising federal deficits and the national debt.
Democrats call the $61 billion in cuts initially pushed by the Republicans extreme, and argue reductions of that scale would have harmed the economic recovery while damaging education and innovation programs essential for continued growth.
The budget brinkmanship showed the political stakes of the situation, with both parties trying to depict the other as unwilling to do what's right for the country.
It also demonstrated the cavernous gap between the two parties on social issues.
Democrats said the Republican drive to defund Planned Parenthood proves the GOP is fixated on abortion and other issues related to women's health. Republicans repeatedly insisted that the size of spending reductions was the main cause of the dispute in recent days.
Levi Russell, a spokesman for the Tea Party Express, told CNN the group isn't "very impressed" with the budget deal and said the agreement proves the party has a lot more work to do to ensure deeper cuts.
Planned Parenthood claimed victory for American women.
"A handful of members of Congress tried to use the debate over our nation's deficit to pursue an extreme agenda that would cut millions of women off from Pap tests, breast exams and birth control -- without reducing the deficit," said President Cecile Richards.
CNN's Dana Bash, Deirdre Walsh, Ted Barrett, John King, Kate Bolduan, Brianna Keilar, Terry Frieden, Ed Henry, Dan Lothian and Tom Cohen contributed to this report