The House of Representatives approved President Trump’s amended North American trade pact on Thursday in an overwhelmingly bipartisan fashion, a rare instance of legislative cooperation in an era of intense political divisions.

The House approved legislation to implement the U.S. Mexico Canada Agreement, or USMCA, by a 385 to 41 vote, with 193 Democrats and 192 Republicans backing the pact. The Senate is expected to pass the legislation early next year, after which the president would sign it into law.

Mexico’s Senate has approved the deal, but it needs ratification in Canada to enter into force and replace the North American Free Trade Agreement, or Nafta.

USMCA seeks to update the original 1994 Nafta by accounting for electronic commerce and revising the rules for the auto trade. But the deal’s broad political appeal stems from measures to place limits on the interests of U.S. multinationals, to hold Mexican labor to higher standards, and to make domestic U.S. manufacturing more competitive. USMCA even includes provisions allowing for the free formation of unions in Mexico.

The deal to advance USMCA, in the middle of the highly partisan impeachment drama in Congress, results from strange bedfellows ultimately finding common ground on trade issues that have eluded a broad consensus for years.

U.S. trade representative Robert Lighthizer asked the U.S. Chamber of Commerce for help dealing with Mexican objections. Freshmen Democrats pressed Speaker Nancy Pelosi for quick action before the election year. The AFL-CIO, which typically opposes trade agreements, surprised many by endorsing a revised version of the pact that reflected a provision offered by Democratic Sens. Sherrod Brown and Ron Wyden.

Mr. Lighthizer, who watched the House vote live from the gallery, sought to bring Democrats and labor groups on board from the beginning of the talks with Canada and Mexico in 2017.

Trade experts worried a failure to get USMCA through Congress this year would cause the pact to die amid heightened political tensions around impeachment and the 2020 election year.

In late November, House Ways and Means Chairman Richard Neal (D., Mass) and Mrs. Pelosi reached a basic “handshake deal” with the Trump administration. But Mexico’s government and business community—whose sign off was crucial—rebuffed the added provisions designed to please Democrats, including labor inspections of Mexican factories, saying they violate the country’s sovereignty.

“There were many times I thought it was dead,” said Mr. Neal, adding that he grew frustrated at times in calls with Mr. Lighthizer. “But I also thought it was too important” to give up.

Seeking to address those concerns, Mr. Lighthizer sought the help of U.S. Chamber of Commerce President Tom Donohue and the business group’s executive vice president for international affairs, Myron Brilliant, who helped the Trump administration overcome differences between Mexicans and congressional Democrats, said people familiar with the conversations.

The Chamber and other business and farm groups also worked with Democrats elected in Trump-supporting congressional districts or swing districts across the country to back USMCA. One group, Farmers for Free Trade, met with more than 40 House lawmakers, mostly Democrats, and even sponsored a motorcade supporting the pact.

Meanwhile Vice President Mike Pence traveled the country, especially targeting Democrat-represented districts that Mr. Trump had won in 2016. One such district was that of Virginia Rep. Abigail Spanberger, a Democrat who spent August focused on how the trade deal would help her district’s dairy and poultry farmers.

She and other freshmen members pushed leadership to get the trade agreement approved quickly. “The day after the impeachment inquiry was announced,” Ms. Spanberger said in an interview, “the next morning meeting was on USMCA.”

For House Republicans, Minority Whip Steve Scalise (R., La.) and Rep. Kevin Brady (R., Texas) began meeting with GOP lawmakers, often arranging phone calls with Mr. Lighthizer, the president’s lead negotiator.

Many doubted Democratic leadership would commit to voting for the pact, given a traditional mistrust of trade agreements. In the end, not all Democrats or unions were on board. The International Association of Machinists and Aerospace Workers, for example, is opposing the pact out of concerns that companies will continue to outsource jobs to Mexico. The United Food and Commercial Workers also declined to endorse it.

Rep. Bill Pascrell (D., N.J.) said the deal “made many improvements but it’s not enough.”

On Dec. 6, following the encouragement from the business community, Mexico and the Trump administration reached a potential agreement and sent details to Mrs. Pelosi, aides said. On Dec. 7, Mr. Lighthizer asked Mrs. Pelosi if he should continue with his planned flight to Mexico the next day to sign the agreement.

The speaker told him: “Go ahead, go to Mexico, visit the lovely anthropological museum and have a nice meal,” but added that there was no agreement yet, according to a senior Democratic aide. Mr. Lighthizer put off his flight.

Loading... Loading... Loading... Loading... Loading... Loading...

Many Democrats were keen to legislate even as the House moved to impeach the president, and by the middle of December, the move to pass USMCA had gained steam. Mrs. Pelosi and Mr. Lighthizer held several more meetings, including with AFL-CIO Chief Rich Trumka. After a flurry of phone calls and final meetings on Dec. 9, Democrats decided to support the deal.

Now the trade deal will move to the Senate. “This one is different, and that’s why I’m supporting it,” Sen. Brown said in an interview. Mr. Brown is preparing to vote for his first trade agreement because it “means that fewer companies will move to Mexico.

Write to William Mauldin at william.mauldin@wsj.com and Natalie Andrews at Natalie.Andrews@wsj.com

Read more about: