Canadian Prime Minister Justin Trudeau addresses supporters at a Liberal Party fundraiser Tuesday in Surrey, British Columbia. (Darryl Dyck/Canadian Press/AP)

Polls showed that Canadians cheered when their prime minister announced this summer that Canada would not be pushed around by President Trump.

But Canadian experts warn that playing to that crowd is a dangerous temptation that could hurt talks over trade in North America.

With Canadian leader Justin Trudeau having a run of political bad luck at home, many are watching to see, as negotiations over the North American Free Trade Agreement (NAFTA) resumed Wednesday, how his team navigates the fine line between catering to a domestic audience and striking a deal with the United States.

A setback in the talks might momentarily “might give people a reason to beat their chests, but that’s not going to produce increases in the economy,” said Derek Burney, a top official in former prime minister Brian Mulroney’s government in the 1980s and 1990s.

Trump’s provocative rhetoric “makes [Trudeau’s] task a little easier, frankly,” in terms of public support, Burney said. “It just makes getting a proper deal more challenging.”

The idea that Trudeau may be tempted to talk tougher to earn popularity is “misguided,” said a top official at the trade talks. The government believes Canadian public opinion will ultimately rest on the outcome of the talks.

“It’s important to be tough and strong when it comes to the national interest,” said the official, who spoke on the condition of anonymity because of the sensitivity of the talks. “With that being said, I think we and the U.S. and Mexico would all like to see a swift conclusion to these negotiations.”

Trudeau’s political mishaps started with a disastrous trip to India in February, but they came to a head last week. His government had committed over $4 billion to take over an oil pipeline project through Vancouver, only to find its construction halted by a court decision on Thursday.

With a federal election expected next year, the pipeline gamble has turned into a political lose-lose, leaving many Canadians furious that it appears it won’t go or that Trudeau supported it in the first place.

The same week, Canada learned it had been unexpectedly shut out of a two-way preliminary trade deal between Mexico and the United States.

The political pileup will only increase Canadian negotiators’ resolve to get a deal on NAFTA, experts say.

But Canadian polls show that defiance is popular, particularly when it comes to trade negotiations.

In July, more than 70 percent of Canadians surveyed said they approved of Trudeau’s handling of trade relations with Trump, according to a Globe and Mail-CTV poll.

Results like that may have played into Trudeau’s decision Tuesday to draw a firm line on certain issues, telling the media that Canada won’t accept U.S. proposals to do away with a key dispute resolution clause or Canadian cultural protections.

Trudeau’s political opponents said the move worried them. Last week, Foreign Affairs Minister Chrystia Freeland refused to confirm her team’s bargaining position or to comment on inflammatory reported remarks by Trump about the talks.

“Last week, if the [foreign affairs] minister was saying we don’t negotiate in public, that should be our line, and our own prime minister shouldn’t undermine that a few days later,” said Erin O’Toole, a Conservative member of Parliament who serves as his party’s official critic on foreign affairs.

“Donald Trump is hard to deal with; nobody questions that,” he said. “Don’t bring domestic politics into it — that’ll only complicate things.”

On the other side of the political spectrum, Trudeau’s approach to Trump has already earned him significant leeway. The leader of Canada’s left-leaning New Democratic Party, Jagmeet Singh, tweeted on Friday that “Trump is trying to force a bad deal on Canadians, and our government is right to take the time it needs to get this deal right.”

The government also enjoys rave reviews from union leaders. Unifor President Jerry Dias, whose 315,000 members include thousands of autoworkers who would be adversely affected by the auto tariffs Trump has threatened, has spoken supportively to Canadian media camped outside the talks in Washington.

Dias said in an interview that he believes Trudeau has shown “great leadership.”

“Canadians are giving the government a lot of credit for standing firm,” he said. “Folding to the Trump idea, to the Trump agenda, is a bigger political loser.”

In a sense, experts say, the easier task for Trudeau to is act on Canadian public opinion on Trump. The more difficult thing will be to predict voters’ reaction to different versions of a reworked trade agreement.

Canadians want to achieve some sort of agreement, if only to have stability and certainty in their economy, pollster Nik Nanos said. “I think it’s going to have a significant impact on his evaluation, on people’s evaluation of him as a prime minister.”

Besides, the damage that’s been done to Trudeau’s support, particularly in Alberta and British Columbia around the pipeline debacle, won’t be undone by trade talks, said Jared Wesley, a political scientist at the University of Alberta who used to work in that province’s government.

“NAFTA’s not playing here at all,” he said. “It hasn’t been on the front page in a long time.”

Another thing making serious talk difficult right now is the “elastic” deadlines, Burney said. “Nobody’s going to expose their bottom card in the negotiation until they know there’s no more room.”