Another of the key Canadian government officials at the center of a controversy over SNC-Lavalin Group Inc. is leaving his post.

Michael Wernick announced his retirement Monday as clerk of the privy council, the highest-ranking position in Canada’s civil service and a key aide to Justin Trudeau. The prime minister named Ian Shugart, currently deputy minister of foreign affairs, to replace him.

Wernick said in a letter to Trudeau that “recent events” led him to conclude he couldn’t hold his post during the election campaign this fall. “It is now apparent that there is no path for me to have a relationship of mutual trust and respect with the leaders of the opposition parties,” he said, citing the need for impartiality on the issue of potential foreign interference. The exact date of his departure is unclear.

Canada’s former justice minister and attorney general, Jody Wilson-Raybould, quit cabinet in February, alleging several key Trudeau government figures pressured her to intervene to end a criminal prosecution against Montreal-based construction giant SNC. Wernick was among those she named in saying the prime minister’s office wanted her to pursue a negotiated settlement.

Wernick has since twice spoken to a committee of lawmakers investigating the case, and during that testimony both defended his actions on the SNC file and warned about the risk of foreign election interference.

“I’m deeply concerned about my country right now, its politics and where it’s headed. I worry about foreign interference in the upcoming election,” he said in his first appearance before the House of Commons justice committee, before repeating the warning a second time this month. “If that was seen as alarmist, so be it. I was pulling the alarm. We need a public debate about foreign interference.”

The clerk, who is meant to be non-partisan in service of the government of the day, also criticized comments by a Conservative senator and praised one of Trudeau’s cabinet ministers.

Wernick’s testimony as criticized as overly cozy with the ruling Liberals. Murray Rankin, a New Democratic Party lawmaker, asked the clerk how lawmakers could “do anything but conclude that you have in fact crossed the line into partisan activity?” Green Party Leader Elizabeth May said he seemed “willing to interfere in partisan fashion for whoever is in power.”

Trudeau had already lost a top political aide, Gerald Butts, to the scandal. A second minister, Jane Philpott, followed Wilson-Raybould in quitting cabinet.

Also Monday, Trudeau appointed a former deputy prime minister in a Liberal government, Anne McLellan, as a special adviser to investigate some of the legal questions raised by the controversy. They include how governments should interact with the attorney general and whether that role should continue to be held by the justice minister.

The Liberal government hasn’t ruled out helping SNC by ordering a deferred prosecution agreement in the corruption and bribery case, which centers around the company’s work in Moammar Qaddafi’s Libya. Doing so would allow the company to pay a fine and avoid any ban on receiving government contracts. That decision is up to the current attorney general, David Lametti.