WASHINGTON — The White House and House Democrats reached an agreement to strengthen labor, environmental, pharmaceutical and enforcement provisions in President Trump’s North American trade pact, a significant development that made it all but certain that the signature trade deal would become law.

The agreement on a revised United States-Mexico-Canada Agreement was announced on Tuesday by Speaker Nancy Pelosi after months of negotiations, handing Mr. Trump one of his biggest legislative victories less than an hour after she unveiled articles of impeachment.

Ms. Pelosi went from a news conference on impeachment to another on the trade deal, where she and top Democrats, including Representative Richard E. Neal of Massachusetts, pointed to concessions they had secured in closed-door negotiations with the administration.

“We’re declaring victory for the American worker,” Ms. Pelosi said. “It is infinitely better than what was initially proposed by the administration.”