OTTAWA — His testimony was calm, measured and respectful. Whether it helped erase a taint on the leader of Canada remains to be seen.

Gerald Butts, Prime Minister Justin Trudeau’s close friend and former top political aide, tried on Wednesday to defuse a scandal gripping the country, denying that any improper pressure was put on the former justice minister to settle a criminal case.

In much-anticipated televised testimony before a parliamentary committee, Mr. Butts painted his interactions with the former minister and attorney general, Jody Wilson-Raybould, on the corruption case against a large company as minimal and friendly.

And he said his two discussions with her had been aimed at carefully considering what would happen to thousands of Canadian jobs if the company were convicted.

“When 9,000 people’s jobs are at stake, it is a public policy problem of the highest order,” Mr. Butts said. “It was our obligation to exhaustively consider options the law allows.”

While no one disputed that it was the attorney general’s decision to make, he said, “It would, however, be Canadians’ decision to live with.”

Mr. Butts, who knows Mr. Trudeau from their days at McGill University, faced a difficult task: To change the political narrative around the controversy, rehabilitate the public image of his best friend and former boss, while not disparaging Ms. Wilson-Raybould, whose testimony suggested unsavory political back-room tactics.

With the federal election seven months away, and Trudeau’s popularity sinking, Mr. Butts’s testimony was critical in re-establishing the prime minister’s image as a feminist leader committed to an open, “sunny” style.

Some political experts said Mr. Butts, who is credited with masterminding Mr. Trudeau’s political rise, succeeded. But others said the main person who needs to speak is Mr. Trudeau.

“Canadians need to hear from the prime minister, not just committee testimony,” said Lori Turnbull, a professor of political science at Dalhousie University in Halifax, Nova Scotia.

The picture Mr. Butts painted differed starkly from the one Ms. Wilson-Raybould depicted from the same spot a week ago — that she had been hounded for over four months with “inappropriate pressure” and “veiled threats” to avoid a criminal conviction of the Canadian construction giant, SNC-Lavalin, by letting the company pay a multimillion dollar fine instead.

The belief, Mr. Butts said, was that a criminal conviction would have imperiled Canadian jobs by barring the company from doing government business for a decade.

Many believed Ms. Wilson-Raybould paid a heavy price for her refusal to comply — demoted to a lesser cabinet position. She abruptly resigned last month.

But Mr. Butts portrayed the situation as ordinary government operations.

He denied that staffers pressured Ms. Wilson-Raybould, saying they merely advised her to seek independent legal advice on how to apply a new law that would allow the fine.

He also denied that the justice minister had been punished, saying her new assignment was part of an ordinary cabinet shuffle.

Over more than two and a half hours of testimony and questions, Mr. Butts kept his voice low and his tone muted and cordial.

He presented himself not as the throne of political power, but the son of a coal miner who knew the price of shuttered plants and lost jobs.

His tie was askew and he wore a coal miner’s pin in his lapel. He repeatedly called Ms. Wilson-Raybould a “valued colleague” and a friend.

“Gerald Butts’ testimony casts the SNC-Lavalin issue in a very different light, and will likely alter Canadians’ perception,” said Myer Siemiatycki, a politics professor at Ryerson University in Toronto.

Others disagreed. “We need to hear more, from more people involved,” said Maureen Mancuso, a political-science professor at the University of Guelph.

At the center of the crisis, which began a month ago, is SNC-Lavalin, charged in 2015 with bribing Libyan officials during the dictatorship of Col. Muammar el-Qaddafi and defrauding the Libyan government.

It was Ms. Wilson-Raybould’s job to either allow the prosecution to continue, or apply a new criminal law allowing the company to pay a large fine, as companies can do in similar arrangements in Britain and the United States.

In her testimony, which lasted almost four hours, she said she felt it was improper for politics to influence the case.

She described 10 meetings, 10 calls and several emails in which she had been asked to order prosecutors to use the new law to cut a deal with the company.

But Mr. Butts said that the number of interactions was minimal, compared with the hundred meetings he had attended to debate the government’s purchase of the contested Trans Mountain pipeline or meetings on the Nafta agreement.

“This, to me, begs the entire question of what constitutes pressure,” Mr. Butts said. “According to the former attorney general, 11 people made contact with her office over four months. That’s two meetings and two phone calls per month.”

Mr. Butts took pains throughout his testimony not to criticize Ms. Wilson-Raybould, or pick apart her version of events.

But he did cast a dinner they had last December in a very different light. She remembered having told him she wanted “everyone to stop talking to me about SNC as I had made up my mind.” He said he recalled no such statement.

“There was nothing remotely negative about the exchange from my perspective,” Mr. Butts said. “In fact, I walked away from dinner thinking it was the best discussion we had had in a while.”

A couple hours after the meal, they exchanged friendly text messages, which he read aloud, that bore no residue of conflict. Instead, Ms. Wilson-Raybould appeared to thank him and say “alo” to the prime minister.

In a statement, Ms. Wilson-Raybould did not directly comment on Mr. Butts’s testimony, but expressed willingness to again appear before the committee.

In the end, SNC-Lavalin’s case is proceeding as a criminal prosecution. But in January, Ms. Wilson-Raybould was moved from justice to the less prestigious post of veterans affairs.

“The January Cabinet shuffle had absolutely nothing to do with the SNC-Lavalin,” Mr. Butts told the justice committee, adding, however, that his relationship with Ms. Wilson-Raybould had deteriorated significantly by then.

The shuffle was sparked by another cabinet minister’s departure, he said. Ms. Wilson-Raybould, a lawyer and a former Indigenous leader in British Columbia, was offered the Indigenous Affairs portfolio.

“Then minister Wilson-Raybould did something I didn’t expect,” Mr. Butts said. “I had never seen anyone do it before, in many shuffles, over many years. The former Attorney-General turned down a Cabinet portfolio.”

Mr. Butts said Ms. Wilson-Raybould explained that she had “spent her life opposed to the Indian Act and couldn’t be in charge of the programs administered under its authority.”

While Ms. Wilson-Raybould wanted to remain at justice, her “dream job,” Mr. Butts said he had advised Mr. Trudeau that allowing that would set a bad precedent, and the only other post Mr. Trudeau could offer her was veterans affairs.

“Cabinet invitations are not the product of shared decision-making,” he said. “It is the prime minister’s decision to make and his alone to make.”

Mr. Butts resigned two weeks ago out of what he called loyalty to the prime minister.

“If I stayed on, his actions or inactions toward me could have been used to accuse him of playing favorites, that he was choosing his best friend over a minister,” he said. “I could not allow our friendship to be held against him.”

His final words to the committee seemed like a farewell note. He thanked members for their service and friendship. The question that remains is whether his sacrifice worked.