WASHINGTON — The Senate stepped away from the brink of a meltdown on Tuesday, confirming one of President Barack Obama’s long-stalled nominees, agreeing to quick action on others and finessing a Democratic threat to overturn historic rules that protect minority-party rights.

“Nobody wants to come to Armageddon here,” said Sen. Chuck Schumer, the New York Democrat whose talks with Arizona Republican John McCain were critical in avoiding a collision that had threatened to plunge the Senate even deeper into partisan gridlock.

McCain told reporters that forging the deal was “probably the hardest thing I’ve been involved in.”

The White House reaped the first fruits of the deal, when Richard Cordray’s nomination to head the Consumer Financial Protection Bureau was approved 66-34. He was first nominated in July 2011 and has been in office by virtue of a recess appointment that bypassed the Senate.

In a written statement, Obama said he was pleased by the developments and that he hoped Congress would “build on this spirit of cooperation” to pass immigration legislation and rein in interest rates on student loans, among other measures.

As part of Tuesday’s agreement, both parties preserved their rights to resume combat over future nominations, Republicans by delaying votes and Democrats by threatening to change the rules governing such delays.

Still, officials in both parties said they hoped the deal would signal a new time for the Senate.

Under the agreement, several of seven stalled nominees would win confirmation later in the week, including Labor Secretary-designate Tom Perez; Gina McCarthy, named to lead the Environmental Protection Agency; and Fred Hochberg to head the Export-Import Bank.

Even before the agreement was ratified, Cordray’s long-stalled nomination to head the Consumer Finance Protection Bureau advanced toward approval on a test vote of 71-29.

Two nominees to the National Labor Relations Board, Richard Griffin and Sharon Clark, are to be replaced by new selections. Obama installed Griffin and Clark in their posts by recess appointments in 2011, bypassing the Senate but triggering a legal challenge. An appeals court recently said the two appointments were invalid, and the Supreme Court has agreed to review the case.

In their places, Obama nominated Nancy Schiffer, a former top lawyer for the AFL-CIO, and Kent Hirozawa, counsel to NLRB Chairman Mark Pearce.

Pearce, awaiting confirmation to a new term, is the seventh appointee at issue. His pick is relatively uncontroversial, and he is likely to be approved along with the replacements for Griffin and Clark. The NLRB appointments would prevent the virtual shutdown of the agency because of a lack of confirmed board members to rule on collective bargaining disputes between unions and companies.

“I think we get what we want, they get what they want. Not a bad deal,” said Reid.

“Crisis averted,” said the Republican leader, Sen. Mitch McConnell of Kentucky.