For reporters, however, it has been a perilous time: Some 34 journalists have died in the line of duty since democracy was restored in 2008, said Mustafa Qadri of Amnesty International, whose report on media freedom is due to be published April 30.

“It is supremely dangerous to be a reporter in Pakistan,” he said.

The military, in particular, has squirmed under the media’s relentless scrutiny. Tensions have been bubbling for some time between the Jang Group, the country’s largest media conglomerate, and the ISI. Jang is owned by Mir Shakil ur-Rehman, a reclusive editor who lives with his two wives in Dubai, where he keeps a tight grip on a media empire that includes Geo News, several sports and entertainment channels, and a stable of newspapers in Urdu and English.

Last fall, Mr. Rehman came to believe that the ISI was sponsoring a new television station, Bol, to dilute his commercial and political clout. His newspapers ran hostile reports about Bol, prompting competing media organizations to hit back with stories that painted Geo as sympathetic to Pakistan’s old rival, India.

Senior figures at Geo claimed the spat had put their lives in danger. In November, Mr. Rehman’s son Ibrahim, who is chief executive of Geo, said he had received warnings of an attack by “the ISI or one of their proxies.” Mr. Mir claimed the ISI tried to lure him away from the station, and had threatened his life.

The tensions erupted publicly after last weekend’s attack on Mr. Mir. His brother, Amir Mir, who is also a journalist, accused the ISI of orchestrating the shooting in an emotional denunciation that was broadcast for hours on Geo, often against a backdrop of a photo of the ISI director general, Gen. Zaheer ul-Islam.

The ISI leadership, stung by the unusually open challenge, reacted angrily. On Tuesday, the military leadership sought to have Geo shut down and its editors prosecuted for “a libelous and scandalous” campaign that it said violated the country’s media law. On Thursday, television viewers in major cities found that Geo had disappeared from its usual position on their cable television sets. And on Friday, posters appeared across central Islamabad that praised the ISI and carried glossy photos of the spy chief, General Islam, a first in a country where many citizens fear to say the letters ISI out loud.