The security establishment is trying to push a certain narrative on the Pakistani public ahead of the July 25 elections.

Last week, a journalist was suspended after he asked Pakistan’s military spokesperson, Major General Asif Ghafoor, an uncomfortable question.

“Now that Nawaz Sharif has been sidelined, and former President Asif Zardari is about to be, maybe you should take care of the scourge called Imran Khan, too, as he will not spare anyone either?” Express News reporter Ahmed Mansoor asked at a press conference.

His comment implied what many in Pakistan have been wondering about: the perceived meddling of the security establishment in politics to pave the way for its favourite candidate, Imran Khan of the Pakistan Tehreek-e-Insaf Party (PTI), to win the upcoming general election. And it seems Mansoor’s question was not well-received.

His suspension comes at the backdrop of a months-long crackdown on the freedom of expression in Pakistan in advance of the July 25 vote. For those who follow Pakistan’s domestic affairs closely, it is clear that this effort to silence independent voices in the media is part of an attempt to unlawfully engineer the country’s political landscape.

Controlling the public narrative

Today, it is quite difficult to steer the public discourse in Pakistan in one direction. Gone are the days when there was only one state-owned television channel that tightly controlled what people were allowed to hear or believe.

Pakistan now has dozens of independent news channels, and thanks to high mobile and internet penetration, the public lives and breathes politics. News shows are the most popular form of entertainment, and a vibrant social mediaallows the public to follow and comment on minute-to-minute developments. Conversations on militancy, foreign policy and court cases of politicians are staples at work, the dinner table and social gatherings.

As a result of all this, the general public has acquired a certain level of independence of thought and is no longer buying official narratives.

And despite the presence of security-establishment-friendly journalists and anchors, who push a certain discourse and observe the red lines, there are still some others who continue to do factual reporting.

That is why, in an effort to the reign in the “runaway” narrative before the elections, a brutal crackdown on media houses and journalists was unleashed.

In April, Geo TV, the most critical of the lot and the market leader, was taken off the air and its journalists were threatened. It came back only after its management reportedly agreed to all demands of the military. However, its broadcast is still being blocked in several areas of Pakistan.

In May, the circulation of Dawn, Pakistan’s oldest and most-respected English-language daily newspaper, was blocked across the country. This came right after it published an interview with former Prime Minister Nawaz Sharif in which he questioned the lack of progress in the trial of the alleged mastermind of the November 2008 Mumbai attacks, Hafiz Saeed – a sensitive matter for Pakistan’s security establishment.

Then, in June, at another press conference, Ghafoor declared that the military is monitoring “social media and who’s doing what” and warned of “social media cells”. He also showed a presentation slide with the social media avatars of prominent Pakistani journalists which some perceived as a veiled threat.

These are just a few examples of the ongoing campaign by the security establishment to intimidate critical media professionals in an attempt to turn public opinion against Sharif’s Pakistan Muslim League (PML-N) party and in favour of Imran Khan’s PTI.

All this has to be viewed in the context of the country’s recent political history.

Political games

Last year, Sharif was forced to step down as prime minister after the country’s supreme court unanimously disqualified him on grounds that he lied during a corruption investigation.

But some Pakistanis saw the story differently: It was Sharif’s attempt to try former military ruler General Pervez Musharraf for treason, implement an independent foreign policy and force the military to curb support for Islamist and militant groups that got him ousted.

Now, there are new attempts to block Sharif’s return to power and bring in a weak, puppet-like coalition parliament instead. The establishment needs a compliant and cooperative parliament to undo the 18th constitutional amendment, which was enacted in 2010.

This amendment has been a thorn in the security establishment’s side for two key reasons. First, it makes the direct military intervention in civilian affairs and its endorsement by the judiciary a near impossibility. Second, it devolves power and resources to the provinces, capping funds available to the federal centre.

Successive transfers of power from one popularly elected government to the next in the long term would sound the death knell for the military’s outsized role in Pakistan’s politics and policymaking.

But to reverse the 18th amendment, without throwing the country into political turmoil and mass riots, the military needs a change in government and to make this a reality it needs to sell a narrative.

Sharif has been portrayed as a dishonest politician involved in election-rigging and corruption. After an inquiry into alleged vote-rigging at the 2013 elections failed to produce any results, the former prime minister was then targeted with a corruption court case for failing to disclose the source of funds used to pay for two luxury apartments in the UK.

This narrative has also failed so far, as polls continue to show that the PML-N is leading in the polls ahead of the PTI. When Sharif returned with his daughter, Maryam, on July 13 to serve his jail sentence, he was greeted by a large crowd of supporters at the airport in Lahore. Thousands joined the rally despite the roadblocks, riot police and the shutting down of mobile networks.

What we are witnessing in Pakistan at the moment is the first mass resistance to the military’s political engineering attempts since East Pakistan seceded to become Bangladesh after the Pakistani army’s bloody attacks on the Bengali population in 1971.

The poll results on July 25, however, will show how much of this revolt will translate itself into a push-back to bring Sharif’s party to power again.

The views expressed in this article are the author’s own and do not necessarily reflect Al Jazeera’s editorial stance.