WASHINGTON — President Barack Obama’s trade agenda was dealt a stinging setback by members of his own party Tuesday, as a bill that would have given him the authority to accelerate the negotiation of a massive trade pact failed a procedural test vote in the Senate, 52 to 45.

In an unexpected twist, liberal Democrats who have long expressed qualms with the Trans-Pacific Partnership (TPP) united with other party members who favor the trade agreement but voted against beginning debate on trade promotion authority, or fast track, legislation because it was not packaged with other bills dealing with trade enforcement. The legislation needed 60 votes to advance.

Giving the Obama administration trade promotion authority would mean the Trans-Pacific Agreement, which involves 12 countries on the Pacific Rim, would have to muster only a simple majority in the House and Senate for approval, with members forfeiting their ability to add amendments or filibuster.

Among Senate Democrats’ demands were that the fast-track legislation include a customs enforcement measure to crack down on currency manipulation, a practice undertaken by China and other Asian countries that artificially holds down the price of exports. Republicans, who had already agreed to link trade promotion authority with assistance for workers displaced by trade, refused to bow to the additional requirements.

“I’m not a fan of fast track, but it’s very important that the Senate’s ongoing debate about trade is not limited to legislation granting President Obama fast track authority,” Senate Minority Leader Harry Reid, D-Nev., said on the floor during debate. “If the Senate is going to talk about trade, we must consider its impact on the American worker and the middle class, and that’s what the customs provision does.”

Even Sen. Ron Wyden, D-Ore., a co-author of the fast-track bill, voted against the legislation. “This is a group that is thoroughly committed to getting this bill passed,” he said to reporters after a strategy meeting with pro-trade Democrats. “The group is concerned about the lack of a commitment to trade enforcement.”

The debate over trade has roiled Democrats in recent weeks, as Obama has gone to battle with Democratic lawmakers and progressive groups in an intraparty policy debate that has gotten unexpectedly sharp. The liberal criticism of the TPP goes beyond packaging fast-track legislation with trade enforcement provisions. Opponents say the deal would allow corporations to challenge U.S. environmental and labor regulations and offer few protections for U.S. workers and wages, which have been hit hard by past trade deals.

“We spent a lot of time in the last two years talking to the administration about ways to negotiate a trade agreement that would help in the developing world, help richer countries, would help us in our country raise standards and move in the right direction,” said Sen. Sherrod Brown, D-Ohio, one of the leading opponents of the TPP in its current form. “The administration has chosen not to listen. They want to do trade policy the way we’ve done it in the past, and clearly it hasn’t worked if you look at trade deficits and what’s happened in states like Michigan and Ohio.”

Senate Majority Leader Mitch McConnell, R-Ky., chided Democrats shortly after the failed vote. “What we just witnessed here is the Democratic Senate shut down the opportunity to debate the top economic priority of the Democratic president,” he said. “I sure hope some of our colleagues across the aisle will heed the words of President Obama and rethink their choice.”

The procedural failure was a victory for the broad progressive coalition, including labor unions, environmental groups and corporate watchdogs, which united against the trade promotion authority and the Trans-Pacific Partnership.

“The Hatch-Wyden-Ryan fast-track bill is halted — for now. That’s good news for America’s working families, domestic producers and communities,” AFL-CIO President Richard Trumka said in a statement, referring to the legislation and the senators who authored it. “If Congress is serious about creating jobs, reviving U.S. manufacturing and raising wages, it needs to use its leverage to reshape the terms of the Trans-Pacific Partnership.”

Many Democrats said that they are not reflexively opposed to trade, as Obama has alleged, but that the current version of the TPP does not meet their criteria for a good trade agreement that corrects the mistakes of the past.

“We’re respectful of the president and the administration, but we think that on many issues, they simply don’t have it right yet,” said Rep. Sander Levin, D-Mich. “We’re emphatic about not giving up our leverage until those issues are gotten right.”

The White House appeared to downplay the defeat Tuesday afternoon.

“It is not unprecedented — to say the least — for the United States Senate to encounter procedural snafus,” said White House spokesman Josh Earnest during the day’s press briefing.