House Democrats dealt President Obama a humiliating defeat on his free-trade initiative Friday, derailing a key priority for the president and rebuffing his rare, personal pleas for their support.

The defeat at the hands of his own party placed Obama’s trade agenda in limbo and exposed deep party divisions on economic policy, leaving the pro-trade Democrats marginalized by the anti-corporate wing of the party, which has been on the rise since the 2008 financial collapse. It also exposed the weakening hand of House Minority Leader Nancy Pelosi (D-Calif.), who had worked for days to avoid a Democratic takedown of the president’s agenda, only to throw her support in with the rank-and-file rebellion at the last minute.

The fate of the trade legislation now depends on Obama’s ability, along with business-friendly interests, to persuade dozens of Democrats to switch their votes before a planned do-over vote early next week.

The key roll call came on a measure to grant financial aid to displaced workers, with 144 Democrats linking arms with 158 Republicans in a rout that left the overall package of trade bills stalled. Despite Obama’s entreaty to “play it straight,” Democrats rejected a program that they had almost universally supported in the past because its failure also ensured the failure of the centerpiece measure, the “fast-track” negotiating authority. House leaders structured the voting so that it required passage of three separate measures for the legislation to advance.

“I will be voting to slow down fast-track,” Pelosi said on the floor moments before the vote. “Today we have an opportunity to slow down. Whatever the deal is with other countries, we want a better deal for American workers.”

Friday’s setback dimmed hopes at the White House that Obama will be able to complete the Trans-Pacific Partnership (TPP), a sweeping free-trade and regulatory pact that he has called central to his economic agenda at home and his foreign-policy strategy in Asia. Obama’s loss came after a months-long lobbying blitz in which the president invested significant personal credibility and political capital.

Republican leaders, who had backed the president’s trade initiative, pleaded with their colleagues to support the deal or risk watching the United States lose economic ground in Asia. Afterward, GOP leaders said the battle was not over, but they made clear the onus was on Obama to sway his fellow Democrats.

“The president has some work yet to do with his party to complete this process,” said Rep. Paul Ryan (R-Wis.), chairman of the House Ways and Means Committee. “This isn’t over yet.”

White House press secretary Josh Earnest insisted that the president’s trade agenda is still alive and vowed that Obama will continue to urge passage of the package in the coming days. Earnest said that the Senate approved the fast-track legislation last month after initially voting to block it.

The silver lining for Obama and his unusual Republican allies is that the balance of the trade package narrowly won support. The House voted 219 to 211 to approve fast-track, also known as trade promotion authority, which had been expected to be the most crucial vote.

On that vote, 219 to 211, 28 Democrats joined 191 Republicans in supporting the president.

But because House leaders split the bill into several pieces, approval of the worker assistance program — known as trade adjustment assistance, or TAA — is needed to advance fast-track.

The White House dismissed the defeat of President Obama’s Pacific Rim free-trade initiative as “another procedural snafu” in Congress. (Reuters)

The problem for Obama is that he must still get enough Democratic votes to entice a sufficient number of Republicans to vote for TAA, which they generally do not support.

In his first visit to the Democratic caucus in two years, Obama pleaded for their support, particularly on a bill that they would otherwise back on the merits.

“Play it straight,” Obama said, according to several attendees.

The president recounted his previous efforts on behalf of workers and the environment to loud applause audible in the hallway outside. “I don’t think you ever nail anything down around here,” Obama told reporters on his way out of the Capitol. “It’s always moving.”

According to an aide familiar with the discussion, Pelosi told the president she was “leaning no” on the trade assistance vote at a meeting before Obama went before the entire Democratic caucus.

Several hours later, Pelosi walked onto the chamber’s floor and indicated she would do the opposite of what Obama had asked her and her colleagues to do — vote against a program she otherwise supports in order to obstruct the overall package.

Pelosi said she still thinks there is a “path to yes” on fast-track authority, as she has said for months, but that it must be “lengthened” in order to address “sinkholes.”

That ended days of private deliberations for Pelosi. She personally negotiated the precise fixes to the TAA bill with House Speaker John A. Boehner (R-Ohio), who then set up the series of votes to take place exactly as she had asked.

Exiting the Obama meeting, some of Pelosi’s closest lieutenants thought she would support the worker assistance program and nudge it to passage.

“She would not have gone through the efforts — these heroic efforts — to get this deal and then just to vote against this,” Rep. Steve Israel (D-N.Y.), an appointed member of her leadership team, said before the key vote. “I’m voting for trade adjustment assistance. I believe that the vast majority of leadership will be voting for trade adjustment assistance.”

Israel, Rep. James E. Clyburn (D-S.C.) and House Minority Whip Steny H. Hoyer (D-Md.) were the only members of leadership to support the president on the TAA vote.

After Pelosi delivered the final blow to the legislation, she sent a letter to all Democrats saying that stopping the fast-track bill was their way to leverage support for a massive infrastructure bill.

However, in a sign of their disjointed posture, other Democrats had other ideas about what they were trying to get by stopping the trade package. “The real issue here is TPP, and this is an effort to get TPP on the right track,” said Rep. Sander M. Levin (Mich.), the ranking Democrat on the Ways and Means Committee.

Levin said “the focus of these next days” would be to force the Obama administration to reopen portions of the negotiations with Pacific Rim nations on worker organizing rights and currency ma­nipu­la­tion.

Another bloc of Democrats said it did not want any leverage — they were fine with blocking any more trade deals, even if it means losing the worker assistance program.

“I understand the president’s point of view. I just fundamentally disagree with it,” said Rep. Daniel Kildee (D-Mich.). “If I’m opposed to [fast-track] authority, it’s logical that I would use every tool that I can to try to stop it.”

A few members suggested Obama’s last-minute outreach backfired.

“He made it like, ‘You are questioning me and my integrity.’ He implied we have to say, ‘We trust you, so what you’re doing is fine.’ And I don’t agree with that,” said Rep. Keith Ellison (D-Minn.).

Rep. Peter A. DeFazio (D-Ore.) bristled at the “play it straight” suggestion on TAA. “Basically, the president tried to both guilt people and then impugn their integrity,” he said.

While a victory would have propelled Obama toward success on a legacy-building issue in his final years in office, the loss constitutes a major embarrassment for a president who has invested significant personal credibility and political capital in the fight.

That effort culminated in his Capitol visit Friday but included a trip to Nationals Park Thursday night to watch portions of the congressional baseball game pitting Republicans against Democrats.