WASHINGTON — The Trump administration eased off its threat to exclude Canada from the North American Free Trade Agreement, extending talks that were set to end on Friday while warning that the Canadians must be “willing” to accept the United States’ terms.

After four days of marathon negotiations between Canadian and American officials failed to produce an agreement, the White House told Congress that it would enter into a revised trade deal with Mexico and that it was up to Canada to decide whether to remain in the trilateral Nafta pact.

“Today the president notified the Congress of his intent to sign a trade agreement with Mexico — and Canada, if it is willing — 90 days from now,” Robert E. Lighthizer, the United States trade representative, said in a statement.

The White House agreement to keep talking has less to do with a change of heart than with political realities: Congress, which has ultimate authority over trade agreements, has warned the White House that any revised deal must include both Canada and Mexico. Canada is the major export destination for 36 American states, and many of the president’s political supporters insisted that he first “do no harm” to the deal. Without Canada, Republican lawmakers would be likely to scuttle any new Nafta pact, dealing Mr. Trump an embarrassing loss.