The ruling means more challenges for a company at the center of the biggest crisis to hit Liberal Prime Minister Justin Trudeau since he took power in 2015.

Trudeau’s government faces allegations that top officials pressured former attorney general Jody Wilson-Raybould to direct prosecutors to strike a deal rather than go ahead with a trial.

In a ruling, Justice Catherine Kane said the company’s application for a review of the prosecutors’ decision “had no reasonable prospect of success.”

Her decision means SNC-Lavalin’s only hope of avoiding trial is for the new attorney general, David Lametti, to agree to a so-called deferred prosecution agreement (DPA) that would see the company pay a big fine instead.

Trudeau, whose prospects for winning an election in October have dimmed as the crisis grows, sidestepped questions from reporters about the ruling on Friday, repeating his government was focused on trying to protect jobs.

“On this specific question of a DPA, that is the Attorney General’s decision to make ... and the Attorney General will make that decision,” he said in the Arctic city of Iqaluit.

The company said in a statement it was disappointed and vowed to “vigorously defend itself against the charges in court if no remediation agreement is possible”.

SNC-Lavalin, which employs 9,000 people in Canada and tens of thousands abroad, is accused of bribing Libyan officials to get contracts between 2001 and 2011.

It wants a DPA on the grounds it has removed the executives in charge at the time and overhauled its ethics and compliance systems. A deal would have been both in the public interest and in the interest of “innocent stakeholders” such as employees, customers, shareholders and pensioners, it said.

A court conviction would bar SNC-Lavalin from bidding on government contracts for 10 years, possibly forcing it to cut jobs in Quebec.

The preliminary hearings in the case are ongoing.

The affair has prompted the resignation of two high-profile ministers and Trudeau’s closest political aide.

Quebec is a political stronghold for Trudeau and is seen as key to his party’s chances of re-election in an October election against a resurgent Conservative opposition.

SNC-Lavalin shares were down 0.44 percent at 3 pm eastern (2000 GMT), in line with declines in the broader market.

Reporting by David Ljunggren and Julie Gordon; Editing by Jonathan Oatis and James Dalgleish