WASHINGTON — President Obama’s trade initiatives headed toward a decisive showdown Friday with little margin for error, as his regular allies on Capitol Hill mounted a furious last-ditch effort to derail a key vote and anxious Republicans tried to gather support for a White House that has normally been their deepest enemy.

Obama’s top advisers shuttled up and down Pennsylvania Avenue Thursday in a bid to shore up Democrats, fearful that the fallout from a defeat at the hands of the president’s own party would leave Democrats an internal feud for weeks on end.

Republicans remained focused on trying to pry loose votes from rank-and-file conservatives who otherwise support expanded trade but have made a political living off bashing the Democratic president.

During a critical vote Thursday evening, 34 Republicans opposed their leadership and nearly sabotaged the debate before it even formally started, but eight Democrats broke ranks to set the stage for a pair of Friday votes that will determine the outcome of Trade Promotion Authority.

When the gavel fell, giving Obama and Republicans an early win, Rep. Paul Ryan, R-Wis., pumped his arm, fist-bumped three Republicans around him and high-fived another. The chairman of the Ways and Means Committee, Ryan served as his party’s 2012 vice-presidential nominee and lead critic of Obama’s first-term agenda.

Leaders in neither party expressed confidence in what could be a razor-thin margin during Friday’s votes, with House Speaker John Boehner, R-Ohio, merely saying that he will match the vote total that he has privately promised Obama.

“We’ll do our part,” Boehner told reporters Thursday.

Upward of 200 Republicans could support the president, and about 20 Democrats have publicly pledged their support – a total that would just barely clear the majority needed to send the legislation to Obama’s desk for his signature.

The centerpiece of the legislation would grant the president six years of “fast track” authority to freely negotiate trade accords, limiting Congress’s role in their approval to a simple up-or-down vote. Obama has said he needs this authority to negotiate the final details of the Trans-Pacific Partnership, so the other nations know that Obama can submit the deal without congressional tinkering.

Unions have argued that another round of trade deals will lead to more offshoring of jobs and depress wages at home. Vote counts remained fluid on each side, but by late Thursday the focus had narrowed to the most liberal faction of House Democrats.

Top White House officials were summoned to the Capitol by House Minority Leader Nancy Pelosi, D-Calif., to address skeptical Democrats on Thursday. In an unusual setup, the presidential team addressed the Democrats in a closed-door basement meeting room, and after they left, Democrats then heard from Richard Trumka, president of the AFL-CIO.

The debate has laid bare the division among Democrats on economic policy, with an increasingly vocal coalition of liberal activists saying that increased global trade benefits multinational corporations while doing little for the middle class.

The final wrangling among Democrats is not focused on the trade authority, but instead on a related provision that would provide financial assistance to workers and communities harmed by foreign trade deals. That Trade Adjustment Assistance legislation, or TAA, has historically won wide support among Democrats, and its inclusion alongside fast-track authority has typically helped persuade skeptical Democrats to support the overall package.

There will be two votes – one for the trade authority, expected to receive huge GOP support and some Democratic support, and one for worker assistance, which would normally garner huge Democratic support and some Republican votes.