President Barack Obama signed into law a $2.1 trillion budget package Tuesday, capping months of grueling partisan wrangling that brought the nation to the brink of a historic default on its obligations.

Just two hours before the president signed the measure, the Senate voted, 74-26, to pass the bill, which will raise the debt limit and reduce the deficit. The final vote came with little of the drama that marked the last few weeks of negotiations that blew up again and again. However, the vote came just hours before the Treasury Department had warned the U.S. would default on its debt. The House passed the measure Monday, 269-161.

Though Obama relented this weekend to a deal with Republicans that requires no new tax revenue to help reduce the deficit, the president said Tuesday that he is still looking for the "balanced approach" to deficit reduction that he had originally sought. He said a new joint committee created by the law should institute changes to both entitlements, such as Medicare, and also to the tax code.

"I've said it before; I will say it again: We can't balance the budget on the backs of the very people who have borne the biggest brunt of this recession," Obama said. "We can't make it tougher for young people to go to college or ask seniors to pay more for health care or ask scientists to give up on promising medical research because we couldn't close a tax shelter for the most fortunate among us. Everyone is going to have to chip in. It's only fair. That's the principle I'll be fighting for during the next phase of this process."

Many Republicans chalked up the deficit reduction deal as an opening victory in their quest for smaller government, and it came despite having a Democrat in the White House and a Democratic majority in the Senate.

Senate Minority Leader Mitch McConnell (R-Ky.), who played a key role brokering the deal, said that far from showing dysfunction, it was a debate that "Washington very much needed to have."

McConnell said the debate will be a template for all future debt limit hikes.

"Never again will any president be allowed to raise the debt ceiling without being held accountable for it by the American people," he said.

Democrats grudgingly accepted a plan that includes no upfront revenue and significantly limits spending for the domestic spending programs they have championed, in return for avoiding a potentially catastrophic crisis.

"Our country was literally on the verge of a disaster," Senate Majority Leader Harry Reid said.

The Nevada Democrat hailed the bill as a compromise that would help reduce the deficit and stabilize the economy, but he expressed regret that Republicans would not consent to any tax increases as part of the package.

"The richest of the rich ... contributed nothing to this," he said, and he expressed hope that the joint deficit reduction committee set up by the legislation would rectify that.

"That's not going to happen, otherwise the trigger is going to kick in," he said. Under that trigger, defense and domestic programs including Medicare would face an automatic $1.2 trillion spending cut starting in 2013.

For many liberals, the bill was too bitter a pill. Sen. Jeff Merkley (D-Ore.) said Republicans used "extortion" to get Democrats to agree to the plan. He said it failed to take on any of the tax breaks that benefit the wealthy or corporations.

Conservative Republicans, meanwhile, complained the package left almost all of the cuts to 2013 and beyond — effectively leaving it up to the next Congress and the president.

The backloaded nature of the deal also came under fire from GOP conservatives, considering more than 98 percent of the claimed savings would come after next year's election. The $21 billion in deficit reduction over the first year of the agreement would cover less than a week's worth of borrowing, Moran noted.

Republicans and Democrats alike also complained about the two-step nature of the deal, with a $917 billion agreement to slice spending over the next decade now and another $1.2 trillion to $1.5 trillion to come later from the new joint committee by Thanksgiving.

"We've wasted this crisis," Sen. Tom Carper (D-Del.) said on the floor Monday, complaining that the Senate should have embraced the $3.7 trillion "gang of six" plan that was based on the Bowles-Simpson plan from last year's fiscal commission.

And Minority Whip Jon Kyl (R-Ariz.) supported the deal, although he said the defense cuts, including the spending-cut trigger, came close to a violation of lawmakers' oath of office.

Of the 74 Senate supporters of the bill, 46 were Members of the Democratic Conference and 28 were Republicans. Six Democrats, 19 Republicans and Democratic-leaning Independent Sen. Bernie Sanders (Vt.) voted against the deal.

But with the deal done, the larger sense in both parties is one of relief. The debate over the debt ceiling had brought the nation's other business to a virtual standstill.

And the bill effectively includes a budget for appropriations bills for fiscal years 2012 and 2013, potentially smoothing the way for Congress to avoid another bruising shutdown showdown before the election.