When Justin Trudeau formed his first cabinet after winning an election in 2015, it was a triumphant affair. The prime-minister-elect marched to Rideau Hall, home to the Queen's representative in Canada, like a conquering hero, surrounded by beaming ministers.

Early last week, half a political lifetime later, he walked to the hall with just his security detail to make the third change to his Cabinet this year. The usually media-friendly Trudeau did not stop. Waiting reporters thought they heard him mutter "Having a good day ..." as he slipped in by a side door.

There have not been many good days for the prime minister since the publication in February of allegations that he and his officials put pressure on the then-attorney general to fine rather than prosecute SNC-Lavalin, a large construction firm in Quebec accused of bribery.

In their wake has come a slew of resignations. Jody Wilson-Raybould, the former attorney general, left the Cabinet on Feb. 12, followed by Jane Philpott, a respected minister who later quit in sympathy. Gerry Butts, Trudeau's senior adviser, took responsibility for "a communication breakdown" and resigned. Last week Michael Wernick, Canada's highest-ranking civil servant, told Trudeau he too would go, since he is no longer trusted by the opposition.

It has been quite a comedown for the Liberal leader, whose pre-election promises of openness and transparency are being thrown back in his face by Conservative opponents scenting victory in a federal election due on Oct. 21. But it is too soon to count Trudeau out.

The case against him and his officials is that they attempted to obstruct justice by urging Wilson-Raybould to offer SNC-Lavalin a deal under which the company would pay a fine and agree to mend its ways in order to avoid a trial.

She told the parliamentary justice committee, which has been investigating the case, that she did indeed feel pressure. But she added that the harassment, though inappropriate, was not illegal. (The attorney general, who is a member of the Cabinet, is not supposed to be influenced by political considerations.) Trudeau admits he raised concerns about job losses but did not direct Wilson-Raybould to change her decision. The case is still going to trial.

The details may be murky but, said Darrell Bricker of Ipsos, a polling firm, voters smell a rat. An average of recent polls shows the Liberals behind the Conservatives, by 33 percent to 35 percent.

Sensing they are on to a winner, the Conservatives have been demanding that Wilson-Raybould come back to parliament to testify again. (That hope died when the Liberals used their majority to end the committee's investigation.) The Conservative #LetHerSpeak campaign on social media targets another of Trudeau's soft spots. After championing the rights of women and indigenous peoples, he finds himself at daggers drawn with Wilson-Raybould, who is both female and a member of the We Wai Kai nation.

But the Conservative opposition is not benefiting as much as might be expected. It has its own vulnerabilities. The party has tacked rightward under its leader, Andrew Scheer, after a dissident member, Maxime Bernier, set up a new party even further to the right.

Before the SNC-Lavalin scandal, the Conservatives had been hammering the government for letting too many asylum-seekers cross the border with the United States. But Scheer is finding it hard to appeal to anti-immigrant supporters without offending the large majority of Canadians who back immigration.