Privy Council Clerk Michael Wernick is leaving his post as Canada's top bureaucrat, saying there is "no path" for him to have a "relationship of mutual trust and respect" with opposition party leaders.

The longtime public servant was thrust into the spotlight following allegations he and members of the Prime Minister's Office tried to pressure former justice minister Jody Wilson-Raybould to sign a remediation agreement and avoid sending the Quebec engineering firm SNC-Lavalin to trial. Wernick has denied making "veiled threats" to pressure Wilson-Raybould.

In a letter to Prime Minister Justin Trudeau announcing his retirement, Wernick wrote that "recent events have led me to conclude that I cannot serve as clerk of the Privy Council and secretary to cabinet during the upcoming election campaign."

Wernick's first appearance in front of the justice committee over SNC-Lavalin — during which he both defended his role in the affair and bemoaned the state of political discourse in Canada — was widely criticized by Opposition MPs and pundits as a partisan display.

"I worry about the rising tide of incitements to violence when people use terms like 'treason' and 'traitor' in open discourse," he told the committee. "Those are words that lead to assassination. I'm worried that somebody is going to be shot in this country this year during the political campaign."

Role needs to be seen as non-partisan: Wernick

His statement prompted NDP MP Charlie Angus to call for his resignation.

"Mr. Wernick has overstepped his role," Angus wrote in an open letter to Trudeau earlier this month.

"He is now a central figure in a serious political controversy."

Wernick said working with Opposition parties would be difficult going forward.

The Clerk of the Privy Council has put himself in a completely untenable situation as a non-partisan public servant. He is now a central figure in a serious political controversy. I've written to the Prime Minister calling for his resignation. <a href="https://t.co/NSjyIFJWir">https://t.co/NSjyIFJWir</a> —@CharlieAngusNDP

"One of the key roles of the Privy Council Office is to be ready to assist whichever government Canadians elect in October," he wrote.

"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 ... Therefore, I wish to relinquish these roles before the election. It is essential that Canadians continue to see their world-leading public service as non-partisan and there to provide excellent services to Canadians and the governments they elect."

Trudeau didn't ask for resignation: PMO

As clerk, Wernick also served on the new "critical election incident public protocol" team.

As part of that team, Wernick — along with the national security and intelligence adviser and the deputy ministers of justice, public safety and foreign affairs — was supposed to alert the public of any election interference during the campaign period, also known as the writ period.

"It is essential that during the writ period the clerk be seen by all political parties as an impartial arbiter of whether serious foreign interference has occurred," he wrote in his retirement letter.

On Monday, the Prime Minister's Office announced that Ian Shugart, the deputy minister of foreign affairs, will take over as clerk. Shugart has served in multiple posts since the late 1970s and worked as a Conservative political staffer during the Brian Mulroney years.

It's not clear exactly when Wernick, who was named clerk in 2016 and has worked in the public service for nearly 38 years, is leaving the post.

"The timing of my retirement is something we should discuss, as your government will have a busy cabinet agenda until the end of the parliamentary session, and you will want to seek advice on how best to address succession," says his letter.

Clerk of the Privy Council Michael Wernick, right, and Justice Department deputy minister Nathalie Drouin appear before the Standing Committee on Justice and Human Rights regarding the SNC Lavalin affair, on Parliament Hill in Ottawa on March 6, 2019. (Justin Tang/Canadian Press)

Wernick also hinted that he "will have more to say later."

A spokesman for the prime minister said Trudeau did not ask for Wernick's resignation.

In a statement, Trudeau thanked Wernick for his many years of service to Canada.

"He has distinguished himself as a dedicated public servant, focused on building a modern, agile and world-class Public Service that places the needs of Canadians at the forefront of its work," he wrote.

"I also thank him for his support over the last few years as we worked to implement an ambitious agenda to build a better future for the people and communities at the heart of this country."

New adviser role

Wernick's sudden departure quickly erupted in question period in the House of Commons on Monday — the first after a two-week break.

So did Prime Minister Justin Trudeau's announcement that former Liberal cabinet minister Anne McLellan will serve as a special adviser on the dual role of justice ministers and attorneys general in cabinet.

Both topics likely will be raised when the justice committee meets again tomorrow — this time behind closed doors.

Last month, Ethics Commissioner Mario Dion announced he'd investigate claims that the Prime Minister's Office tried to influence Wilson-Raybould on the SNC-Lavalin file.

Dion has stepped aside temporarily for health reasons. His office says it will continue to gather information on ongoing investigations in his absence.