Updated

House Republican leaders have planned for a two-day debate beginning Thursday on President Obama's trade agenda, culminating in a final showdown vote Friday.

House Majority Leader Kevin McCarthy, R-Calif., sent a memo to members of the GOP caucus late Wednesday laying out the plan for legislation that has forged an unusual alliance between Obama and Republican leaders on Capitol Hill.

The first bill to be taken up Thursday will concern Obama's bid for so-called "fast track" trade authority. Previous presidents have enjoyed the authority, which lets them present Congress with proposed trade agreements that it can ratify or reject, but not change.

The issue may turn on how the House resolves a side issue: how to pay for a program to retrain workers displaced by trade agreements, known as Trade Adjustment Assistance, or TAA.

A Senate-passed bill now facing the House would divert money from Medicare to fund the job retraining program. But House Democrats call that unacceptable, and demand another funding source.

Republicans agreed, but insisted on putting the alternative funding mechanism in a trade bill separate from the fast-track measure. They are desperate to avoid changing even a comma in the fast-track bill, because that would send it back to the Senate and give opponents another chance to filibuster and throttle it there.

GOP leaders say Democrats should accept the promise that if all the trade bills become law, only the non-Medicare source of money will fund the retraining program. But many Democrats are balking. They say they won't vote for language calling for Medicare spending cuts, even if Obama and others promise that the alternative funding methods will make sure the cuts never take place.

The GOP leadership's plan calls for two crucial votes Friday. The first is to fund TAA, which many Republicans oppose. If enough Democrats join them, because of the funding issue, it could scuttle the entire trade package.

If the TAA measure survives, the House would vote on fast-track authority. As few as 20 Democrats might support it. That means at least 198 of the House's 246 Republicans would have to vote yes to pass the bill.

"Republicans are going to do our part, but the president will have to deliver on TAA to get this done," said Kevin Smith, a spokesman for House Speaker John Boehner, R-Ohio.

Unions fiercely oppose Obama's agenda, saying free-trade agreements shift U.S. jobs overseas and help countries with poor environmental and workplace standards.

Republican leaders are seeking more GOP votes by appealing to conservatives with language to limit trade agreements' impact on immigration, climate policy and other issues.

Late Wednesday, Obama sent top aides to huddle with House Democratic leaders. They included White House Chief of Staff Denis McDonough and U.S. Trade Representative Michael Froman. Later, Boehner met with Minority Leader Nancy Pelosi, D-Calif.

If Obama obtains fast track authority, he hopes to advance the long-negotiated Trans-Pacific Partnership with 11 other nations, including Japan and Vietnam.

The AFL-CIO, a potent player in Democratic politics, urged lawmakers to reject the GOP-drafted plans for the jobs retraining program, saying the money is insufficient.

Rep. Gerry Connolly, D-Va., a supporter of the trade deal, said the dispute over the Medicare issue threatened to take the bill down even though most Democrats complaining were already leaning "no."

"This contretemps over the TAA has stirred up all the silt and so I don't know right now where we are," Connolly said.

If the unions prevail, it would mark a brutal setback for Obama, who says U.S. products must reach wider markets. But his chief allies on trade -- that is, the Republican leaders who oppose him on so many other issues -- said they still think they can eke out a win.

Rep. Mark Sanford, R-S.C., said he's inclined to support fast track mainly for the trade benefits to his home state. However, he said, "it's a tough vote for any conservative," including himself, because so many constituents deeply mistrust Obama and don't want him to receive any new authorities.

"The conservative base is ginned up about this," Sanford said, "and that's why it's going down to the wire."

Fox News' Chad Pergram and the Associated Press contributed to this report.