Washington (CNN) -- President Barack Obama on Tuesday signed into law a last-minute compromise plan to raise the nation's $14.3 trillion debt ceiling, narrowly averting what could have been an unprecedented default with calamitous economic consequences.
Obama's signature capped a tumultuous negotiation with congressional leaders that spanned months before finally coming up with an agreement on Sunday, two days before the government said it would run short of money pay its bills while lacking the authority to borrow any more.
On Monday, the U.S. House passed the compromise measure by a 269-161 vote, overcoming opposition from unhappy liberal Democrats and tea party Republicans.
Then the Senate passed the plan, which imposes sweeping new spending cuts over the next decade, on a 74-26 vote on Tuesday afternoon. Shortly afterward, Obama praised the deal as "an important first step for ensuring that as a nation we live within our means."
But the American economy "didn't need Washington to come along with a manufactured crisis," the president noted. "It's pretty likely that the uncertainty surrounding the raising of the debt ceiling -- for both businesses and consumers -- has been unsettling, and just one more impediment to the full recovery that we need. And it was something that we could have avoided entirely."
"Voters may have chosen divided government, but they sure didn't vote for dysfunctional government," the president said. He signed the deal into law less than an hour later.
If the debt ceiling had not been increased before the end of Tuesday, Americans could have seen rapidly rising interest rates, a falling dollar and shakier financial markets, among other problems, because the government would have been unable to borrow more money to account for the difference between revenue it collects and bills it owes.
Regardless, the federal government could still face a credit rating downgrade.
Credit rating agency Moody's said Tuesday the United States will keep its sterling AAA credit rating for the time being, but lowered its outlook on U.S. debt to "negative." A "negative outlook" indicates the possibility that Moody's would downgrade the country's sovereign credit rating within a year or two.
Final passage and signing of the debt ceiling agreement didn't impress Wall Street, with the Dow Jones industrial average dropping for an eighth straight day.
The agreement reached Sunday by Obama and congressional leaders from both parties calls for up to $2.4 trillion in savings over the next decade, raises the debt ceiling through the end of 2012 and establishes a special congressional committee to recommend long-term fiscal reforms.
Emotions ran high during the final debates on Capitol Hill. Numerous Republicans remained worried about cuts in defense spending and the lack of a required balanced budget amendment to the Constitution. Progressive Democrats were livid over the extent of the deal's domestic spending cuts, as well as the absence of any immediate tax hikes on high-income Americans.
"On this matter, my conscience is conflicted," Sen. Dick Durbin, D-Illinois, said Tuesday morning. "If we should default on our debt, terrible things will ensue."
But if "we continue to move toward more and more spending cuts, we will literally disadvantage the poor and working families of America to the advantage of those who are well off," Durbin said.
Sen. Mark Kirk, R-Illinois, praised the agreement as "a down payment on further ways to bring common sense ... to the spending of our government,"
"If we fail, we deliver a free people into the hands of financial bondage," he warned.
Sen. Joe Lieberman, an independent from Connecticut who is part of the Democratic caucus, called the deal a first step in "a long, hard march back to fiscal responsibility in our country."
"Nobody seems perfectly satisfied with it, but that's inevitable," Lieberman said. "For me, the positive outweighs the negative."
GOP leaders sold the deal to skeptical rank-and-file Republicans in recent days by arguing that it will finally begin the process of reforming spending and taming the growing debt, a key goal of conservatives who fueled the GOP takeover of the House in last year's midterm elections.
Top Democrats have focused on the fact that the bill preserves benefits from popular entitlement programs such as Medicare and takes the politically problematic debt ceiling issue off the table until 2013.
In the end, the majority of both Democrats and Republicans supported the legislation in the Senate.
In the House, Speaker John Boehner, R-Ohio, was able to round up the support of most of his GOP caucus, while the chamber's two top Democrats -- Minority Leader Nancy Pelosi of California and Minority Whip Steny Hoyer of Maryland -- voted for the plan along with more than 90 of their caucus members.
One of those supporting the plan was Rep. Gabrielle Giffords, D-Arizona, who cast her first House vote since being shot in the head in an assassination attempt in January. She received an emotional ovation when she entered the chamber.
In an op-ed to be published Wednesday in the Washington Post, Treasury Secretary Tim Geithner argued that the process of forging the agreement was terrible, but the result is good.
"The agreement creates room for the private sector to continue to grow, without the threat of default and the burden of higher interest rates," Geithner wrote, noting the measure passed Tuesday locks in at least $2 trillion in long-term savings that are "phased in gradually to avoid hurting the economy in the near term."
Referring to the pressure exerted by tea party conservatives in the House on the negotiating process, Geithner also wrote that because the agreement allows the debt ceiling to be extended through 2012, "it should not be possible for a small minority to threaten catastrophe if the rest of the government decides not to embrace an extreme agenda of austerity and the dismantling of programs for the elderly and the less fortunate."
The agreement revolves around a two-stage process.
The first stage includes $917 billion in savings, including a roughly $420 billion reduction in the national security budget. The cuts will be accompanied by a $900 billion increase in the debt ceiling.
Because of the need to immediately increase borrowing, Obama has immediate authority to raise the debt ceiling by $400 billion, which will last through September. The other $500 billion increase in the debt limit is subject to a congressional vote of disapproval that can be vetoed by the president.
In the second stage, a special joint committee of Congress will recommend further deficit reduction steps totaling $1.5 trillion or more, with Congress obligated to vote on the panel's proposals by the end of the year.
The committee will comprise 12 members, six from each chamber, equally divided between Democrats and Republicans. The panel's recommendations are due by November 23 and are guaranteed an up-or-down vote without amendments by December 23.
The committee is expected to consider politically sensitive reforms to the tax code and entitlement programs, though Democrats and Republicans disagree on the likelihood of any eventual revenue increases.
If the committee's recommendations are enacted, Obama will be authorized to increase the debt ceiling by up to $1.5 trillion. If the recommendations are not enacted, Obama can still raise the debt ceiling by $1.2 trillion. At that point, however, a budget "trigger" will kick in, imposing mandatory across-the-board spending cuts matching the size of the debt ceiling increase.
The cuts would be split between defense spending and non-defense programs, an unpopular formula intended to motivate legislators to approve the committee's recommendations.
"You want to make it hard for (lawmakers) just to walk away and wash their hands," Gene Sperling, the director of Obama's National Economic Council, said Sunday. "You want them to say, if nothing happens, there will be a very tough degree of pain that will take place."
The final debt ceiling increase in the agreement is also subject to a congressional vote of disapproval that can be vetoed by Obama.
The agreement calls for both houses of Congress to vote on a balanced budget amendment to the Constitution, though it does not make a further increase in the debt limit subject to congressional passage of such an amendment -- something tea party conservatives were initially demanding.
Leaders on both sides of the aisle have openly conceded that the deal is far from perfect.
"Neither side got what they wanted," Senate Majority Leader Harry Reid, D-Nevada, said Tuesday. "Each side laments some of the things we had to give up, but that's the way it is."
A new CNN/ORC International Poll shows that only 44% of Americans approve of the debt ceiling deal, while 52% disapprove.
According to the Monday survey, Republicans dislike the fact that the deal raises the debt ceiling through 2013, while Democrats dislike the lack of any tax increases on businesses or higher-income Americans.
Only 17% of Americans believe that their elected officials have behaved like "responsible adults" during the debt ceiling debate, while 77% believe they have acted like "spoiled children."
"I think all of us need to reflect on how these institutions are conducting themselves, how members are conducting themselves," said Sen. Kent Conrad, D-North Dakota, who has announced he is not seeking re-election next year. "We need to think about why are we really here. We're here to solve problems. We're not here to worry about the next election, and unfortunately there's too much focus on pure partisan politics and not enough focus on solving problems confronting the country."
CNN's Ted Barrett, Kate Bolduan, Gloria Borger, Keating Holland, Brianna Keilar, Jeanne Sahadi, Xuan Thai, Jessica Yellin, Athena Jones, Lisa Desjardins, Dan Lothian and Deirdre Walsh contributed to this report.