OTTAWA — After promising an open and collaborative way of doing politics, Prime Minister Justin Trudeau of Canada on Tuesday axed from his party two prominent former female cabinet ministers who have been at the center of a festering political crisis about his handling of a criminal case.

Trying to divert the country’s attention from the controversy, Mr. Trudeau was in a tough spot politically.

The two women were seen by many as symbols of his progressive feminist government. But within his Liberal Party, they were seen as untrustworthy backstabbers who kept the firestorm alive for weeks with new morsels of information feasted upon by the press and opposition parties.

The problems began two months ago when accusations surfaced that Mr. Trudeau and his aides inappropriately pressured Jody Wilson-Raybould, the former justice minister and attorney general, to settle a criminal corruption case against SNC-Lavalin, a major corporation based in Montreal. A criminal conviction would bar the company from government contracts for a decade.