President Obama and congressional leaders Sunday night sealed a deal to raise the federal debt limit that includes sharp spending cuts but no new taxes, breaking a partisan impasse that has driven the nation to the brink of a government default.

The agreement brings to an end a self-created crisis that has consumed Washington, rattled Wall Street, and shaken confidence in the American political system at home and abroad. The deal could clear Congress as soon as Monday night — barely 24 hours before Treasury officials have said they could begin running short of cash to pay the nation’s bills.

Passage of the agreement, however, remained far from certain in the House, where skeptical Republicans were just beginning to digest the details.

“This process has been messy. It’s taken far too long,” President Obama said in brief remarks at the White House. “Nevertheless, ultimately, the leaders of both parties have found their way toward compromise, and I want to thank them for that.”

Obama said the agreement “will allow us to avoid default and end the crisis that Washington imposed on the rest of America. It ensures also that we will not face this same kind of crisis again in six months, or eight months, or12 months. And it will begin to lift the cloud of debt and the cloud of uncertainty that hangs over our economy.”

The deal was negotiated primarily by Vice President Biden and Senate Minority Leader Mitch McConnell (R-Ky.). It teetered all day on the edge of completion as House Speaker John A. Boehner (R-Ohio) bickered with Democrats over whether to freeze next year’s defense budget.

In the end, Boehner conceded the point, and Obama finalized the agreement in phone calls to each of the four congressional leaders shortly after 8 p.m.

The agreement would raise the $14.3 trillion debt limit in two stages by as much as $2.4 trillion. It represents a victory for Obama, allowing him to avoid another grueling fight over the debt limit in the heat of the 2012 presidential campaign.

But he failed to secure other top priorities, including fresh measures to revive the flagging recovery and an end to tax breaks for corporations and the wealthy. Obama said he would pursue those goals later this year, when, under the terms of the deal, a new congressional committee would begin searching for further ways to control the national debt.

“The ultimate solution to our deficit problem must be balanced,” Obama said Sunday. “That’s why the second part of this agreement is so important.”

Republicans, by contrast, won severe cuts to agency budgets over the next decade and the prospect of deeper cuts to come, delivering on the campaign promises that helped them gain control of the House in the fall congressional elections. Democrats also agreed to stage a vote on a balanced-budget amendment, which has become a rallying point for tea-party-aligned conservatives.

End of the impasse

The deal ends a painful political stalemate that had been in the making since the new GOP majority took control of the House in January. After a bitter showdown over this year’s budget nearly shut down the government in April, the parties launched into the debt-limit battle.

At several points, Obama and Boehner held out hope they could agree on a far-reaching bipartisan plan to tame the soaring national debt once and for all by raising taxes and cutting health and retirement spending. But House Republicans repeatedly walked away from the bargaining table, refusing to raise taxes. In the end, policymakers were left with a far more modest achievement that does little more than resolve the immediate crisis.

On Sunday, party leaders wearily took what they could get.

“There is now a framework to review that will ensure significant cuts in Washington spending,” McConnell said in a speech on the Senate floor. “And we can assure the American people tonight that the United States of America will not for the first time in our history default on its obligations.”

Senate Majority Leader Harry M. Reid (D-Nev.) also welcomed the deal.

“I’m relieved to say that leaders from both parties have come together for the sake of our economy to reach a historic bipartian compromise that ends this dangerous standoff,” he said.

McConnell and Reid were laying plans for a vote as soon as Monday afternoon. Opposition in the Senate appeared to be melting. Liberals were not enthusiastic about the agreement, but the biggest potential roadblock — tea party Republicans who had threatened to block Senate action — said they would permit the measure to move forward.

If approved by the Senate, the measure would move to the House, where Boehner hopes to hold a vote as soon as Monday night, he told GOP lawmakers in a conference call late Sunday. Boehner and his entire leadership team endorsed the plan and encouraged rank-and-file Republicans to do the same.

“If I wrote this myself, it would look different. But I wouldn’t agree to it or put it on the floor if it violated our principles or would hurt the economy,” Boehner said, according to Republicans who participated in the call. “I’m not celebrating, but I’m going to hail the courage of all of you for helping us take this giant step forward.”

According to officials in both parties, the deal would raise the debt limit in two stages. The first increase would total $900 billion, with the Treasury gaining access to $400 billion in additional borrowing authority immediately. The other $500 billion would come later this fall — unless two-thirds of the members of both chambers of Congress objected — permitting the Treas­ury to pay the bills through early next year.

The second increase would raise the debt limit by at least $1.2 trillion, also subject to a resolution of congressional disapproval. That process would place the entire burden for a debt-limit increase on the White House, because Congress is likely to vote to disapprove the request, forcing Obama to veto it. But the process virtually guarantees that the debt limit will rise, because Republicans lack the votes in the Senate to override Obama’s veto.

The agreement would also cut agency spending by roughly $900 billion over the next decade and create a new legislative committee to come up with at least $1.2 trillion in additional savings by the end of this year. For days, the chief obstacle to a deal was the design of a mechanism to force the committee to act — or to make sure spending cuts were adopted if the committee failed.

In the end, negotiators settled on a trigger that would force automatic across-the-board cuts of $1.2 trillion to agency budgets over the next decade, split half and half between domestic programs and defense. Programs for the poor, including Medicaid and Social Security, would be exempted. But Medicare payments to providers could be hit.

Liberal doubts

Liberals were not enthusiastic about the package, arguing that it represents surrender on all their top priorities, including pledges to protect Medicare and to end tax breaks for the rich.

House Minority Leader Nancy Pelosi (D-Calif.) withheld comment, saying she would confer with House Democrats on Monday. Rep. Raul M. Grijalva (D-Ariz.), who heads the 74-member Congressional Progressive Caucus, was blunt about his opposition.

“This deal trades peoples’ livelihoods for the votes of a few unappeasable right-wing radicals, and I will not support it,” he said.

But a bigger stumbling block may be Republicans on the House Armed Services Committee and the Appropriations subcommittee on defense. The two chairmen of those panels, Reps. Howard P. “Buck” McKeon (R-Calif.) and C.W. Bill Young (R-Fla.), held a joint news conference Saturday, vowing to oppose any long-term reduction in defense spending that exceeds $439 billion over the next 10 years. Anything larger “stops with this committee,” McKeon said.

Veterans such as McKeon and Young are the base of Boehner’s support within the House Republican conference, and Boehner is likely to need to win their votes to pass the debt-limit deal, even if Pelosi provides a significant bloc of Democrats.

On Sunday’s House conference call, some lawmakers expressed concern about the proposed Pentagon cuts. But most expressed support for the deal, and aides were cautiously optimistic that the proposal would pass with Democratic support.

Freshman Rep. Mike Kelly (R-Pa.), a car dealer and former football player given to sports metaphors, told Boehner he was ready to vote with the team.

“Grab a Gatorade and smoke a cigarette. You’ve earned it,” Kelly said.

Boehner, an inveterate smoker with a taste for red wine, responded: “How about a merlot and a cigarette?”

Staff writers Walter Pincus, Felicia Sonmez and Rosalind S. Helderman contributed to this report.