WASHINGTON—President Trump said Canada would be left out of a new North American Free Trade Agreement if a “fair deal for the U.S.” isn’t reached—and warned Congress he would terminate the deal entirely if lawmakers “interfere” in the negotiations.

Mr. Trump’s warning on Saturday comes a day after U.S. and Canadian negotiators failed to reach an agreement on Friday, a deadline he set, to revamp the trade deal that includes Mexico. The two sides have agreed to continue the trade talks.

His threat via Twitter coincided with the services at Washington National Cathedral attended by many congressional leaders for the late Republican Arizona Senator John McCain, a frequent adversary.

“There is no political necessity to keep Canada in the new NAFTA deal,” Mr. Trump tweeted. “If we don’t make a fair deal for the U.S. after decade of abuse, Canada will be out. Congress should not interfere with these negotiations or I will simply terminate NAFTA entirely & we will be far better off.” He and other senior U.S. officials have indicated a willingness to replace Nafta with a bilateral Mexico deal in the event Canada and the U.S. can’t resolve differences.

While the president does have the power to terminate the pact, with six months’ notice, it isn’t clear if such a decision could withstand legal challenges, of which there would likely be many.

And lawmakers and business groups whose support has usually been vital for passage of trade pacts have made clear that a bilateral trade deal that excludes Canada would face an uphill battle for the required congressional ratification.

Four days of marathon talks ended with significant differences remaining between the U.S. and Canada. Mr. Trump said he still planned to stick with the timetable he laid out earlier this week to sign a new pact in late November to replace the three-nation accord, which on Saturday he described as “one of the WORST Trade Deals ever made.”

In response to Mr. Trump’s tweets, a spokesman for Canadian Foreign Minister Chrystia Freeland said Canada is committed to working toward a modern Nafta, and “with good will and flexibility on all sides, a win-win-win outcome is achievable.” The spokesman added, though, that Canada would only sign a deal “which is good for Canada.” Canadian officials expect threats from Mr. Trump throughout the talks and maintain such threats won’t affect Ottawa’s strategy, according to a person familiar with the situation.

Mr. Trump’s statement that “Congress should not interfere” with the Nafta talks is likely to provoke bipartisan consternation on Capitol Hill.

Democratic and Republican lawmakers alike tend to believe they have the authority to play a role in shaping trade agreements. Congress in recent years has written increasingly detailed rules requiring the White House to consult in negotiating and enacting deals, most recently in the 2015 Trade Promotion Authority law.

The battle over the balance of power in trade policy will be particularly intense if Mr. Trump tries to proceed with a new Nafta that excludes Canada. Lawmakers from both parties have over the past week warned that if he does so, they would make the required congressional ratification all but impossible, effectively killing it.

The debate revolves around whether the new Nafta will qualify for “fast-track” consideration by Congress, which would enable passage with a simple majority and prohibit any amendments. Only trade agreements considered under “fast-track” have won congressional ratification in recent history. But lawmakers have demanded that in return for their forgoing the ability to change a negotiated trade pact, the president give them detailed advance notification of the type of trade agreement he intends to negotiate.

That is where the potential for conflict lies. Before launching the Nafta negotiations a year ago, Mr. Trump notified Congress that he was entering talks with both Mexico and Canada. Many members of Congress say that as a result, only a treaty with both countries qualifies for fast-track consideration.

“To use Trade Promotion Authority’s ‘fast-track’ procedures, the administration must also reach an agreement with Canada,” Pennsylvania Republican Sen. Pat Toomey said in a statement earlier this week. “Conversion into a bilateral agreement would not qualify for TPA’s ‘fast track’ procedures and would therefore require 60 votes in the Senate.”

Trump administration lawyers have been studying the question and say they disagree. When asked Friday about the argument made by Mr. Toomey and others, a senior administration official told reporters, “That strikes me as an odd reading of the statute.”

But the official added, “At the end of the day, obviously it’s going to be up to the Congress.”

In contrast with Mr. Trump’s warning against congressional meddling, his U.S. trade representative, Robert Lighthizer, has tried to convey the administration’s deference to the role of Capitol Hill.

“Will there be congressional review? Absolutely,” he told reporters on Monday. “Congressional review is a whole process. It’s very detailed... There’s congressional studies, and there’s testimony, and we write a bill together.”

Before Trump’s tweets, some experts were optimistic on Saturday that the U.S.-Canada talks would result in a deal. The negotiations “witnessed progress, not perfection in the NAFTA renovation,” Daniel Ujczo, a trade lawyer with Dickinson Wright in Columbus, Ohio, wrote in a note to clients. “The process is moving forward, and, in spite of the theater... [the] countdown to get a deal signed by the end of November is procedurally on track.”

—Jacob M. Schlesinger contributed to this article

Write to Vivian Salama at Vivian.Salama@wsj.com and Paul Vieira at paul.vieira@wsj.com