ETOBICOKE, Ontario — The front-runner to unseat Prime Minister Justin Trudeau had stopped by a Rotary Club ribfest in this Toronto suburb and was sharing barbecuing tips with reporters.

A group nearby spotted the television cameras around him — and puzzled over just who he might be.

Not one of the voters was able to identify Conservative Party leader Andrew Scheer — the 40-year-old former insurance broker who polls say would be prime minister if the federal election were held today — showing the challenge confronting the country’s conservative movement, and its opportunity.

The 2015 victory of Trudeau, the telegenic son of a former prime minister elected on promises of progressive policies and “sunny ways,” was an international sensation. He seemed to sail through his first years in power, and Canadians have a long history of giving prime ministers who enjoy ruling majorities a second mandate.

But his Liberal Party has bled support this year, in part over allegations that his office brought inappropriate pressure against the attorney general in the prosecution of a construction firm from Trudeau’s home province.

Months of controversy have helped to reshape Canada’s political conversation, amplifying critics on the right, particularly those who challenge the prime minister’s positions on issues such as climate change and refugees.

“If you’re a Conservative, you really have to be thrilled, quite frankly, to be where you are now,” said Andrew MacDougall, the former communications director for Stephen Harper, the longtime Conservative prime minister whom Trudeau defeated in 2015.

The question is whether the Conservatives can capitalize on this turn of events and build momentum, particularly as polls show that the slide in Liberal support has bottomed out and the race is tightening.

Scheer, an affable former speaker of the House of Commons, edged out Conservative rivals to win the party leadership in 2017. But he remains little known outside politics, cutting a much different figure from Trudeau, the Rolling Stone cover model. (“Why can’t he be our president?” the American magazine asked.)

That has left Scheer vulnerable to being defined by rivals.

“With an empty canvas, they can paint a picture,” said Duane Bratt, a political scientist at Mount Royal University in Calgary.

Opponents have cast Scheer as everything from Harper with a smile, to a lap dog of Conservative firebrand Doug Ford, to an intolerant radical.

Scheer has presented himself as a moderate. He says he would cut the federal budget deficit within five years, knock down barriers to interprovincial trade and scrap Trudeau’s federal carbon tax for a cap on carbon for large emitters.

“Canada must be a place where no ambition is too big, where no dream is out of reach and where no government will stand in the way of people working hard to get ahead,” he told an audience in Toronto in May. “I will make sure that the government lives within our means, leaves more money in the pockets of Canadians and lets them get ahead.”

Jim Farney, a political scientist at the University of Regina, said Scheer’s victory in the 2017 leadership race could provide a blueprint for his federal election campaign: He sold himself as a safe second choice.

Harper, who won three elections to serve as prime minister from 2006 to 2015, expanded the Conservative Party’s appeal beyond its traditional base, drawing new support from the suburbs of Toronto and Vancouver that are home to many immigrant voters.

But he lost many of those suburbs to Trudeau in 2015. Some attribute the switch to Trudeau’s positive message and ability to turn out voters who had previously stayed home. Some say the Conservative embrace of a niqab ban and a pledge to set up a tip line to report “barbaric cultural practices” turned off many new Canadians.

Recapturing those suburbs could prove difficult, particularly in the battleground province of Ontario, where Ford, the populist premier, has lost support amid scandal and unpopular budget cuts.

Scheer’s opponents have seized on this. Third-party attack ads that aired during last month’s NBA Finals, won by the Toronto Raptors, cast him as a toady who would “never stand up to Ford.”

Trudeau, too, has lumped the two together. At a campaign-style rally in April, he claimed that Scheer “takes his cues from the Ontario premier, so Canadians can expect much of the same if he ever gets elected.”

Darrell Bricker, the Toronto-based chief executive of Ipsos Public Affairs, said the Conservatives’ ability to manage provincial politics “is going to be critical to their chances.”

Scheer, asked about Ford at the ribfest, blamed past Liberal premiers for Ontario’s budget problems.

“I can say that the same people, the same architects of what happened here . . . moved to Ottawa and are running the federal government,” he said.

Scheer and Ford attended the ribfest on the same day but at different times.

Scheer has been accused of being slow to denounce intolerance and xenophobia within Canada’s conservative movement.

Playing the “extremist card” against Conservatives is a Liberal tradition, Bratt said. But “there have been some things Scheer has done to contribute” to that line of attack, he said.

Last summer, the Conservative Party’s social media accounts posted an ad showing a black man carrying a suitcase toward a hole in a border fence.

The figure walked across a Trudeau tweet from 2017: “To those fleeing prosecution, terror & war, Canadians will welcome you, regardless of your faith. Diversity is our strength #WelcometoCanada.”

Superimposed on the image was a headline from the conservative Financial Post: “Trudeau’s ­holier-than-thou tweet causes migrant crisis — now he needs to fix what he started.”

The post drew a public outcry and was deleted.

The Conservative Party opposed a U.N. pact on global migration, arguing that it would force Canada to surrender its sovereignty over immigration policy to “foreign entities.” The pact is not legally binding, and affirms “the sovereign right of states to determine their national migration policy.”

In February, Scheer addressed demonstrators at a rally in Ottawa organized to protest Trudeau’s energy policies. But many of the rally’s participants were yellow-vest demonstrators, espousing anti-immigrant and anti-Muslim messages and accusing Trudeau of treason. Scheer drew criticism for failing to condemn them.

In May, Scheer tried to put an end to the criticism.

“I find the notion that one’s race, religion, gender or sexual orientation would make anyone in any way superior or inferior to anyone else absolutely repugnant,” he said. “And if there’s anyone who disagrees with that, there’s the door. You’re not welcome here.”

But the same week, Conservative lawmaker Michael Cooper berated a Muslim witness at a parliamentary hearing and read portions of the Christchurch mosque shooter’s manifesto.

Scheer removed Cooper from the justice committee, but did not boot him from the Conservative caucus, igniting fresh criticism.

Analysts say that the Liberals could overplay their hand by hammering Scheer as intolerant but that Conservatives remain vulnerable, given how important the immigrant vote will be to their prospects in October.

“The fine line they need to tread is to make sure they continue their mantra of protecting the border, while at the same time not looking xenophobic or opposed to immigration,” said Nik Nanos, an ­Ottawa-based pollster.

The Conservatives “should not get into culture warrior stuff,” said MacDougall, the former Harper aide. If that means the party loses voters to the far-right People’s Party of Canada, he said, so be it.

Michelle Kiyomi, a 29-year-old university student in Mississauga, Ontario, plans to vote Conservative in October. The Manitoba native said Scheer “is more concerned about the issues affecting everyday Canadians that Trudeau seems to be out of touch with.”

She said it doesn’t matter that he lacks Trudeau’s charisma.

“I’m looking for a leader of a country, not an actor or a personality on the world stage.”