Labor Secretary nominee Thomas Perez testifies on Capitol Hill in Washington. The Senate voted by the slimmest margin Wednesday to end a filibuster against President Barack Obama’s choice to head the Labor Department, as this week’s agreement averting a poisonous partisan clash over nominations and the chamber’s rules barely survived its toughest test so far. (ASSOCIATED PRESS / Molly Riley, File)

WASHINGTON (AP) — The Senate voted by the slimmest margin Wednesday to end a filibuster against President Barack Obama’s choice to head the Labor Department, as this week’s agreement averting a poisonous partisan clash over nominations and the chamber’s rules barely survived its toughest test so far.

It takes 60 votes to end filibusters. With all 52 Democrats and both Democratic-leaning independents voting to halt the delays, Republicans supplied the minimum number of votes needed to keep Perez’s selection alive — six.

In so doing, the GOP seemed to signal that while they would adhere to the agreement, their ranks bristling with unhappiness over the deal itself and against Perez in particular. In the deal announced Tuesday, top Republicans agreed to end delays against seven stalled Obama nominations and Democrats promised to drop efforts to change Senate rules to limit filibusters.

Perez is a top Justice Department official whom Republicans have criticized for his handling of a whistle-blower case against the city of St. Paul, Minn., and for not heeding a congressional subpoena that sought his personal emails in that case.

“What I’m saying to my Republican colleagues is, I don’t care what deal you cut,” said Sen. Marco Rubio, R-Fla., a leader of the opposition to Perez. “How could you possibly agree to move forward on a nomination when the nominee refuses to comply with a congressional subpoena?”

Republicans voting to end the Perez filibuster were Sens. John McCain of Arizona, an architect of this week’s deal, Lamar Alexander of Tennessee, Susan Collins of Maine, Bob Corker of Tennessee, Mark Kirk of Illinois and Lisa Murkowski of Alaska.

It was not clear when the Senate would vote on final confirmation of Perez’s nomination, but it was expected soon.

Minutes earlier, senators voted 82-17 to approve Fred Hochberg to a second four-year term to head the Export-Import Bank, which provides financing for U.S. exporters.

“We have now started a new era, I hope, a new normal here in the Senate” of increased bipartisan cooperation, said Senate Majority Leader Harry Reid, D-Nev., as the day began.

But a day after the agreement on nominations was announced and largely hailed by both parties, conservatives and other Republicans made their unhappiness with Perez — and the overall deal — clear.

“Why would you want somebody in the Cabinet thumbing their noses at the elected representatives of the people of this country,” Sen. Charles Grassley of Iowa, one of the chamber’s senior Republicans, said of Perez.

Sen. Ben Cardin, D-Md., said Perez and the Justice Department had responded to all “reasonable requests” from Congress for information and said, “He’s a professional, he listens and tries to make the right judgment.”

In exchange for cooperation on the nominations, majority Democrats have dropped a threat, for now, to change Senate rules to weaken minority Republicans’ powers. They had been threatening to muscle through a rules change eliminating the need to get 60 votes to free a nomination for final approval.

The pact only addressed the seven initial nominees and left open the possibility that confrontations would emerge anew over future Obama nominations that could spark controversy, such as for federal judges or to head the Internal Revenue Service or Department of Homeland Security.

Votes on Gina McCarthy, Obama’s choice to lead the Environmental Protection Agency, were also expected this week.

Also Wednesday, Richard Cordray was sworn in as director of the Consumer Financial Protection Bureau. The Senate confirmed him on Tuesday, the first of the seven stalled nominations to clear the chamber.

As part of the resulting agreement, Obama withdrew his nominations of two nominees to the National Labor Relations Board, Richard Griffin and Sharon Block, both opposed by the GOP.

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

The seventh Obama appointment involved in the bipartisan deal is Pearce.