Former prime minister Nawaz Sharif on Wednesday accused a former intelligence chief of asking him to resign during opposition protests in 2014, comments likely to further fray tense civil-military relations ahead of general elections.

Nawaz’s allegations, made in court documents before the three-time premier read them to a news conference, were a rare explicit accusation by the veteran leader of political meddling by the military.

In other thinly-veiled remarks aimed at the military, Nawaz, who was ousted by the Supreme Court in July, also suggested he was removed from office over his foreign policy stance and refusal to drop a treason case against former army dictator Pervez Musharraf .

Sharif said the 2014 protests organised by opposition figure Imran Khan, which paralysed capital Islamabad for several months, were designed to send him a message that no good would come from pursuing the Musharraf case.

“Those days, a message was sent to me from the chief of an intelligence agency that I should resign, and if that is not possible, I should go on a long leave,” Nawaz said, without identifying either.

“The demand for my resignation or going on long leave was based on this impression that if Nawaz Sharif was removed from the way it wouldn’t be difficult to wrap up the case against Musharraf.”

Pakistan has a host of intelligence agencies but in the past the military-run Inter-Services Intelligence (ISI) spy agency has most often been accused of election meddling.

The military, which did not immediately respond to a request for comment, has denied it is behind any political interference in the run-up to the general elections expected in July.

In March, Chief of Army Staff General Qamar Javed Bajwa told a group of journalists the military was a neutral institution and was only concerned with protecting other institutions, according to media leaks of Bajwa’s comments.

Nawaz, the founder of the ruling Pakistan Muslim League-Nawaz (PML-N) party, was removed by the Supreme Court over a small source of undeclared income, and later deemed ineligible to head any political party, but has de facto control of PML-N.

He also faces a jail term of up to 14 years in a corruption trial that he calls a “witch hunt” and politically motivated.

Nawaz Sharif’s confrontational approach has cleaved sharp divisions within PML-N, which has been weakened over the past year, and where many lawmakers would prefer a more conciliatory approach with the military.

On Wednesday, Nawaz also suggested he was removed from office because of his foreign policy stance. His government had clashed with the military over control of key issues, especially ties with arch-foe India, the United States and Afghanistan.

“I was becoming a stumbling block in some matters,” he said.

“That’s why, removing me from my office, removing from party, disqualifying for lifetime and kicking from the political process was considered the only solution.”