Lawmakers increased the pressure on their party leaders Friday, fearful that they were driving toward a landmark debt deal that could not pass a bitterly divided Congress.

As a heightened sense of anxiety spread across Capitol Hill, rank-and-file legislators broke off into partisan factions. They lashed out at their leaders in private and public, signed pledges and delivered ultimatums — for Republicans, no fresh tax revenue; for Democrats, no changes to Medicare and Social Security benefits.

“They’re making a grievous mistake if they think they can just present anything to us and assume that because we’re Democrats, we’ll go along with what the president has capitulated to,” Sen. Sheldon Whitehouse (D-R.I.) told reporters.

With the high-stakes debt talks nearing the endgame, Washington’s leaders are caught in a struggle to pry lawmakers from their polarized power centers and toward the political middle.

A potentially historic accord is in the offing, but it would inflict pain across the ideological spectrum. Even if President Obama and the eight congressional negotiators agree to a grand bargain, it is increasingly apparent that Congress could fail to pass it.

“I could see a scenario where everybody agrees to a deal and when they finally put the deal on paper, the guys who agreed to the deal no longer believe it’s a deal,” Sen. Roy Blunt (R-Mo.) said in an interview. “I’m always optimistic. But here I’m pretty neutral.”

Rep. Peter Welch (D-Vt.), who leads a bloc of liberals, was more stark in an interview: “If they can reach a deal, will it get support in either or both caucuses? That’s totally unknown.”

The contours of an agreement to raise the debt limit, which must occur before Aug. 2 or Treasury officials say the country will go into default, are only now coming into focus. It could result in up to $4 trillion in savings over the next decade by overhauling the tax code and tackling all the major drivers of federal spending, including the Pentagon budget and Medicare and Social Security.

Most Republicans say increasing taxes is off the table. Some prominent Republicans are open to eliminating corporate tax loopholes as long as overall rates are lowered and any deal does not result in a net revenue increase. Sen. Rob Portman (R-Ohio) called this the “sweet spot,” adding that “there is an understanding that we need to do both: reduce the spending and reform the tax code.”

Democrats, meanwhile, are adamant about not cutting Medicare and Social Security benefits. “We are not going to reduce the deficit or subsidize tax cuts for the rich on the backs of America’s seniors and working families,” House Minority Leader Nancy Pelosi (D-Calif.) told reporters Friday.

House Speaker John A. Boehner (R-Ohio) sought to tamp down expectations. “It’s not like there’s some imminent deal,” he told reporters, at one point holding his arms far apart to show the gulf between the two sides. “This is a Rubik’s cube that we have not worked out yet.”

Assembling a majority in Congress is always difficult, with 435 representatives and 100 senators who have diverse constituencies and champion varied interests.

Boehner cannot count on Republicans alone to provide enough votes to reach the 218-vote threshold for passage in the House. Many GOP members are opposed to raising the debt limit altogether, either on principle or because they fear alienating tea party activists who propelled their insurgent campaigns and could easily pick a new insurgent in 2012. Without what some lawmakers have dubbed the “hell-no caucus,” Boehner would be forced to rely on Democrats for a majority.

“We make a big trade-off in this country for freedom and input and everybody being heard, and the trade-off is efficiency,” former House Democratic leader Dick Gephardt (Mo.) said in an interview. “The only thing that counts is a majority, and if you don’t have that, nothing’s going to happen.”

One point of agreement is that something has to happen.

“If we can’t figure this out, it will be a pox on both our houses, Republicans and Democrats,” Portman, who was director of the Office of Management and Budget under George W. Bush, said in an interview.

Several lawmakers said a major debt deal would be the single most important domestic policy vote of their careers — and that frustration over private negotiations is growing.

On Thursday morning, Pelosi and House Democratic Whip Steny H. Hoyer (Md.) summoned House Democrats to the Capitol basement for a private meeting before the two leaders attended White House talks.

That’s where Rep. Kathy Hochul — whose May upset in a New York special election was a rallying point — rose to lay out the political risks of including cuts to Medicare in any debt deal.

The program has long been central to the Democratic Party’s identity, and Hochul won her seat in a Republican-leaning district in part by attacking a GOP Medicare plan included in a House-passed 2012 budget. When she returns to her Buffalo area district, she told her colleagues, constituents tell her to keep Medicare solvent and never to cut benefits.

Across the Rotunda, the tension among liberals is equally palpable. For any deal to pass the Senate, it would almost certainly need the blessing of Senate Majority Leader Harry M. Reid (D-Nev.). But Reid is said to be openly skeptical of the big-bang approach — as are many Senate liberals.

“If they bring to the Senate a piece of crap that really comes down heavy on working families and children and the elderly and they expect me to matter-of-factly vote for it, they’ll have another thing coming,” Sen. Bernard Sanders (I-Vt.) said.

Among Republicans, a major dividing point has been the “cut, cap, balance” pledge. It sets a high bar for the debt negotiations, opposing any raising of the borrowing limit without accompanying spending cuts and caps, as well as passage of a constitutional amendment mandating a balanced federal budget.

The pledge is attracting more signatures by the day, both from lawmakers and from the party’s presidential candidates. It effectively locks those Republicans into an all-but-certain “no” vote on any debt deal, since a compromise is unlikely to fully mirror those conditions.

“We just came back from a Fourth of July break and got an earful at home saying, ‘We sent you to Washington to rein in government, so stick to it,’ ” Rep. Scott Garrett (R-N.J.) said. “Some see ‘stick to it’ as ‘vote no.’ Some see ‘stick to it’ as ‘you can raise it but you better get something damn well significant.’ ”

There is other outside pressure, too. Grover Norquist, the influential president of the conservative Americans for Tax Reform, said he has been telling GOP leaders that a tax compromise is unacceptable.

Meanwhile, some presidential hopefuls are further complicating the intraparty calculus. In her first campaign ad, Rep. Michele Bachmann (R-Minn.) declares that she will never vote to raise the debt ceiling. And former Minnesota governor Tim Pawlenty urged Republicans to “stand strong.”

“It’s an important moment for our conservatives in Washington to stand tall and stand strong and stand courageously,” Pawlenty said Thursday in Iowa.

On Capitol Hill, the political theatrics have been intense, even by Washington’s standards. In a week when Congress normally would have been on a holiday recess, lawmakers have rushed into television studios and staged news conferences outlining their conditions for a compromise. They say they will make no concessions.

The definition of compromise, of course, is a settlement based on mutual concessions.

Staff writers Rosalind S. Helderman, Paul Kane, Lori Montgomery, Peter Wallsten and Amy Gardner contributed to this report.