WASHINGTON — Senate leaders reached a deal Tuesday to preserve the filibuster in exchange for Senate confirmation of President Barack Obama’s long-sought first director of the Consumer Financial Protection Bureau as well as most other stalled nominees.

The Senate then voted 71-29 to begin debate on the nomination of Richard Cordray, the acting director of the consumer bureau, which could last for up to eight hours before a final vote in which he would need only 51 supporters for approval.

The other nominees include Tom Perez to head the Labor Department and Gina McCarthy to run the Environmental Protection Agency.

Under the deal, the Senate put aside two nominees for the National Labor Relations Board whom the president appointed during a Senate recess, Richard Griffin and Sharon Block. But organized labor is to be allowed to recommend their replacement nominees, who will receive confirmation votes before the end of the month.

Obama had installed Cordray when the Senate was in recess, angering Republicans.

Sen. Bernard Sanders welcomed the agreement but warned that more must be done to end gridlock in “a seriously dysfunctional Senate.”

“I am pleased that an agreement has been reached in which President Obama finally will get Senate confirmation votes on his nominees to lead the Consumer Financial Protection Bureau, the Department of Labor and the Environmental Protection Agency. This agreement also provides that new nominees for the National Labor Relations Board will be rapidly confirmed,” Sanders said.

“While this addresses an immediate need for the president of the United States to have his Cabinet and other senior officials confirmed, we should be clear that the agreement only addresses one symptom of a seriously dysfunctional U.S. Senate,” Sanders added.

“The issue that now must be addressed is how we create a process in the Senate which allows us to respond to the very serious needs of the American people in a timely and effective way. The United States Senate cannot function with any degree of effectiveness if a super-majority of 60 votes is needed to pass virtually any piece of legislation and huge amounts of time are wasted eating up the clock with parliamentary tactics meant only to delay for delay’s sake. Now is the time for real Senate rules reform.”

Historically, filibusters are extremely rare. The Senate operated under an understanding that only in unusual circumstances would a rule be invoked requiring 60 senators to cut off debate. Since Obama has been in the White House, however, filibusters have become commonplace.

Having once spoken on the Senate floor for more than eight hours against extending Bush-era tax breaks for the wealthy, Sanders said he respects the rights of the minority.

“In my view, if a senator or a group of senators are strenuously opposed to legislation they have the right and duty to come to the floor and, for as long as they want, engage in a talking filibuster by explaining to the American people the reasons for their objection. They should not, however, continue to have the right to abuse arcane Senate rules to block a majority of senators from acting on behalf of the American people,” he said.

Senate Majority Leader Harry Reid expressed confidence that a broader deal was in fact within reach, even if it would leave open the possibility of future filibusters of Obama’s executive nominees. Reid had been threatening to change the rules, to bar such filibusters.

Senators are not questioning the ability to keep using filibusters — in which 41 of the 100 senators can block action — on legislation and judicial nominees, who seek lifetime appointments.

“It is a compromise, and I think we get what we want, they get what they want. Not a bad deal,” Reid said on the Senate floor.

The developments unfolded the day after a closed-door meeting of nearly all 100 senators, eager to avoid a rules change that could poison relations between the two parties.

The deal marks a retreat by Reid from his insistence Monday that Republicans promise not to filibuster future executive nominees. Republican leader Mitch McConnell had privately offered to clear the way for the currently contested nominees — providing Block and Griffin were replaced — said officials in both parties. That’s largely the deal Democrats agreed to Tuesday.

McCain told reporters it was “probably the hardest thing I’ve been involved in.” Noting the Senate recently passed a bipartisan immigration bill, he said, “Maybe we can show more momentum toward bipartisanship.”

McCain said he spoke over several days with Democratic and Republican senators, and with Vice President Joe Biden and White House Chief of Staff Denis McDonough. “At least 10 times it came together and then fell apart because there’s always some new wrinkle,” McCain said.