Justin Trudeau is facing the most explosive crisis of his administration after his former attorney general detailed a months-long campaign by the Canadian prime minister's office to quietly end a legal problem for an iconic Quebec construction firm.

In dramatic testimony that lasted nearly four hours, Jody Wilson-Raybould broke her silence with a detailed account of efforts by Trudeau and top aides to persuade her to step in and end prosecution of SNC-Lavalin Group Inc. She argues it amounted to interference in the judicial system, though concedes it wasn't illegal, while Trudeau says he was trying to prevent job losses in his home province of Quebec.

"I experienced a consistent and sustained effort by many people within the government to seek to politically interfere," the former attorney general said Wednesday afternoon. Wilson-Raybould, who quit the cabinet this month, also said she faced "veiled threats" about what might happen if she refused to order an out-of-court settlement.

Her testimony shook the core of the Trudeau's team, naming him, his finance chief and his most senior aides. The Conservative leader trying to unseat Trudeau in this fall's election called for his resignation, but the prime minister stood his ground and rejected Wilson-Raybould's version of events.

The public airing of grievances will inflame the scandal, which has driven the governing Liberals lower in national polls. The ordeal dredges up ghosts of the party's past, which is marked by hand-in-glove ties with corporate Canada — particularly in Quebec. The political fallout, however, is difficult to predict. Trudeau's path to re-election runs through the largely French-speaking province, where his defense of SNC-Lavalin is being applauded.

Ryan Remiorz/The Canadian Press Canadian Prime Minister Justin Trudeau greets supporters in Montreal on Feb. 27, 2019. Canadian Prime Minister Justin Trudeau greets supporters in Montreal on Feb. 27, 2019. (Ryan Remiorz/The Canadian Press) (Ryan Remiorz/The Canadian Press)

"I and my staff always acted appropriately and professionally," Trudeau said Wednesday night in Montreal, where he was celebrating a Liberal Party by-election victory. "Our government will always focus on jobs and our economy."

The image of Wilson-Raybould, Canada's first Indigenous attorney general, skewering her ex-boss, a famed liberal who pledged to improve relations with native peoples and self-described feminist, has taken the shine off the PM.

“This is a huge, huge blow to Justin Trudeau’s personal brand and Justin Trudeau’s promise of doing politics differently,” a polling firm executive told the New York Times. “That shine is not dented or scratched. It’s been completely scuffed.”

Justin Tang/The Canadian Press Prime Minister Justin Trudeau is embraced by then-Minister of Justice and Attorney General of Canada Jody Wilson-Raybould after delivering a speech on the recognition and implementation of Indigenous rights in the House of Commons on Feb. 14, 2018. Prime Minister Justin Trudeau is embraced by then-Minister of Justice and Attorney General of Canada Jody Wilson-Raybould after delivering a speech on the recognition and implementation of Indigenous rights in the House of Commons on Feb. 14, 2018. (Justin Tang/The Canadian Press) (Justin Tang/The Canadian Press)

Wilson-Raybould was the only Indigenous Canadian in Trudeau's cabinet, before she resigned.

SNC-Lavalin had been pushing for what's known as a deferred prosecution agreement to end a criminal case dating back more than a decade, related to corruption charges involving the former Libyan government. SNC is accused of paying about $36 million dollars in bribes to those connected to the late dictator Muammar Gaddafi, as well as defrauding the Libyan government of nearly $100 million.

The charges relate to the world's largest irrigation system — the Great Man-Made River project.

SNC-Lavalin has said that those responsible for alleged wrongdoing left the company a long time ago. Gaddafi was killed in 2011 by militants aided by a coalition Western nations, including Canada, that provided key air support.

The company's stock plunged the most in six years Oct. 10 when it revealed that the Public Prosecution Service of Canada ruled out a negotiated settlement that would have staved off a trial. Settling out of court would also help the company, which employs about 9,000 people in Canada and 50,000 worldwide, avoid a ban on bidding for federal government contracts.

Wilson-Raybould pulled back the curtain on the effort to change that decision and help the company, in testimony that was aired on national television in its entirety. She spoke to lawmakers only after Trudeau waived privilege to allow her to do so, and believes she wasn't even legally able to intervene.

She said the prime minister and his aides wanted to end the case in part to prevent the company's relocation — and also to avoid electoral fallout for both the federal Liberals and the party's provincial wing. Wilson-Raybould said she resisted intervening because she wanted to uphold the principle of judicial independence and the rule of law, but officials ignored her repeated instructions to stop raising the issue.

The former attorney-general identified a series of phone calls and meetings between her or her staff, and Trudeau or several of his top advisers. They include chief of staff Katie Telford; former principal secretary Gerald Butts, who resigned this month; and senior aides Mathieu Bouchard and Elder Marques. She also cited communications with Finance Minister Bill Morneau and his chief of staff Ben Chin.

One of the meetings was with Trudeau himself, in September. "The prime minister raised the issue immediately. The prime minister asked me to help out, to find a solution here for SNC," Wilson-Raybould said. She said she'd told him she had made up her mind.

"The prime minister again cited the potential loss of jobs and SNC moving," while also stressing that he represents an electoral district in Quebec. She said Privy Council Clerk Michael Wernick, the country's top bureaucrat, also warned her the company "will likely be moving to London" without her intervention.

Discussions continued. Wilson-Raybould said Bouchard at one point said bluntly: "We can have the best policy in the world but we need to get re-elected."

She met Butts in December in Ottawa, and was already frustrated by what she called "the barrage of people hounding me and my staff." She pushed back. "I raised how I needed everybody to stop talking to me about SNC, as I had made up my mind and that the engagements were inappropriate."

She read a text-message conversation with her chief of staff, Jessica Prince, who was relaying a conversation with Butts and Telford. Wilson-Raybould said Prince was told by Butts "there is no solution here that does not involve some interference." She said Prince told her Telford said: "We don't want to debate legalities anymore."