The dramatic agreement, with scant time remaining before Tuesday's deadline, "will allow us to avoid default and end the crisis that Washington imposed on the rest of America," Obama said. Default "would have had a devastating effect on our economy," the president said at the White House, relaying the news to the nation and to financial markets around the world. He thanked the leaders of both parties.
House Speaker John Boehner telephoned Obama at mid-evening to say the agreement had been struck, officials said.
No votes were expected in either house of Congress until Monday at the earliest, to give rank-and-file lawmakers time to review the package.
But leaders in both parties were already beginning the work of rounding up votes.
In a conference call with his rank and file, Boehner said the agreement "isn't the greatest deal in the world, but it shows how much we've changed the terms of the debate in this town."
Obama underscored that point. He said that, if enacted, the agreement would mean "the lowest level of domestic spending since Dwight Eisenhower was president" more than a half century ago.
Senate Democratic leader Harry Reid provided the first word of the agreement.
"Sometimes it seems our two sides disagree on almost everything," he said. "But in the end, reasonable people were able to agree on this: The United States could not take the chance of defaulting on our debt, risking a United States financial collapse and a world-wide depression."
In his remarks, Obama said there will be no initial cuts to entitlement programs like Social Security and Medicare. But he said both could be on the table along with changes in tax law as part of future cuts.
That was a reference to a special joint committee of lawmakers that will be established to recommend a second round of deficit reductions, to be voted on by Congress before year's end as part of an arrangement to raise the debt ceiling yet again. That is expected to be necessary early next year.
Pending final passage, the agreement marked a dramatic reach across party lines that played out over six months and several rounds of negotiating, interspersed by periods of intense partisanship.
A final stick point had concerned possible cuts in the nation's defense budget in the next two years. Republicans wanted less. Democrats pressed for more in an attempt to shield domestic accounts from greater reductions.
Details apparently included in the agreement provide that the federal debt limit would rise in two stages by at least $2.2 trillion, enough to tide the Treasury over until after the 2012 elections.
Big cuts in government spending would be phased in over a decade. Thousands of programs -- the Park Service, Labor Department and housing among them -- could be trimmed to levels last seen years ago.
No Social Security or Medicare benefits would be cut, but the programs could be scoured for other savings. Taxes would be unlikely to rise.
Without legislation in place by Tuesday, the Treasury will not be able to pay all its bills, raising the threat of a default that administration officials say could inflict catastrophic damage on the economy.
If approved, though, a compromise would presumably preserve America's sterling credit rating, reassure investors in financial markets across the globe and possibly reverse the losses that spread across Wall Street in recent days as the threat of a default grew.
Officials familiar with the negotiations said that McConnell had been in frequent contact with Vice President Joe Biden, who has played an influential role across months of negotiations.
In the first stage under the agreement, the nation's debt limit would rise immediately by nearly $1 trillion and spending would be cut by a slightly larger amount over a decade.
That would be followed by creation of the new congressional committee that would have until the end of November to recommend $1.8 trillion or more in deficit cuts, targeting benefit programs such as Medicare, Medicaid and Social Security, or overhauling the tax code. Those deficit cuts would allow a second increase in the debt limit.
If the committee failed to reach its $1.8 trillion target, or Congress failed to approve its recommendations by the end of 2011, lawmakers would then have to vote on a proposed constitutional balanced-budget amendment.
If that failed to pass, automatic spending cuts totaling $1.2 trillion would automatically take effect, and the debt limit would rise by an identical amount.
Social Security, Medicaid and food stamps would be exempt from the automatic cuts, but payments to doctors, nursing homes and other Medicare providers could be trimmed, as could subsidies to insurance companies that offer an alternative to government-run Medicare.
Officials describing those steps spoke on condition of anonymity, citing both the sensitivity of the talks and the potential that details could change.
The deal marked a classic compromise, a triumph of divided government that would let both Obama and Republicans claim they had achieved their objectives.
As the president demanded, the deal would allow the debt limit to rise by enough to tide the Treasury over until after the 2012 elections.
But it appeared Obama's proposal to extend the current payroll tax holiday beyond the end of 2011 would not be included, nor his call for extended unemployment benefits for victims of the recession.
Republicans would win spending cuts of slightly more than the increase in the debt limit, as they have demanded. Additionally, tax increases would be off-limits unless recommended by the bipartisan committee that is expected to include six Republicans and six Democrats. The conservative campaign to force Congress to approve a balanced-budget amendment to the Constitution would be jettisoned.
Congressional Democrats have long insisted that Medicare and Social Security benefits not be cut, a victory for them in the proposal under discussion. Yet they would have to absorb even deeper cuts in hundreds of federal programs than were included in Reid's bill, which many Democrats supported in a symbolic vote on the House floor on Saturday.
As details began to emerge, one liberal organization, Progressive Change Campaign Committee, issued a statement that was harshly critical.
"Seeing a Democratic president take taxing the rich off the table and instead push a deal that will lead to Social Security, Medicare and Medicaid benefit cuts is like entering a bizarre parallel universe -- one with horrific consequences for middle-class families," it said.
While politically powerful business groups like the Chamber of Commerce are expected to support the deal, tea party organizations and others have looked disapprovingly on legislation that doesn't require approval of a balanced-budget amendment.
If they keep to that position, it could present Boehner a challenge in lining up enough votes to support a compromise, just as Obama may have to stand down rebels within his own party.
Associated Press writers Jim Abrams, Ben Feller, Laurie Kellman and Andrew Taylor contributed to this story.