Charges against the parent company and its international unit, which were part of the original case filed in 2015, were withdrawn as part of the guilty plea, prosecutors said.

The case, along with revelations that Mr. Trudeau wore black and brownface as a student and teacher, badly battered Mr. Trudeau’s image. Since his election in 2015, he has positioned himself as a leader who took a new, open approach to politics. And he has trumpeted his credentials as feminist, who appointed a gender-balanced cabinet, and as a defender of Indigenous rights.

But after Ms. Wilson-Raybould’s accusations, his political opponents tried to change the narrative, saying he wasn’t really who he seemed to be.

It didn’t help that Ms. Wilson-Raybould resigned from the cabinet over the case, as did Jane Philpott, the treasury board president, who quit in solidarity. Mr. Trudeau has rejected the assertion that he acted improperly, and in August, after the ethics ruling was announced, said, “the way this happened shouldn’t have happened.”

Mr. Trudeau won re-election in October, but without a voting majority for his Liberal Party in the House of Commons, which analysts attributed to the fallout from the SNC-Lavalin case.

“This put this to bed as a political issue,” said Andrew McDougall, a political scientist at the University of Toronto. “I don’t think many Canadians will be surprised by this outcome.”

The case against the company had remained in limbo since Ms. Wilson-Raybould stepped down. Apparently unwilling to offend voters in Quebec who were concerned about possible job losses, but also unwilling to be seen siding with the company, Mr. Trudeau left it in the hands of his new attorney general, Mr. Lametti.