Populous Pakistan has not yet made the grim headlines spawned by the global coronavirus pandemic, despite reporting its first infections on February 26.

Sadly, in the weeks to come, it will. The number of infections is projected to spiral into the millions. And as the death toll mounts, the blame for the government's failure to learn from the mass outbreaks in neighbouring China and Iran will fall squarely on the government and Prime Minister Imran Khan, whose reluctance to act decisively may cost him dearly.

Initially, its response to the brewing crisis was lackadaisical. Responding to criticism in his first televised speech on March 17, Khan said his government had been monitoring the pandemic since January, but did not begin emergency consultations until the first cluster of infections was identified on March 12.

Notably, this discovery by the opposition-controlled Sindh provincial government exposed the failure of the federal authorities to properly screen and quarantine thousands of pilgrims returning from Iran.

Had Sindh's Chief Minister Murad Ali Shah not taken the initiative to start testing returnees upon learning of the first infections in the provincial capital Karachi, the metropolis of 18 million souls would have become another Wuhan, and health authorities in other provinces would not have been alerted to the infectiousness of the pilgrims.

However, when Khan addressed the subject, he was absurdly fatalistic. The spread of the coronavirus was inevitable, he said, but there was no need to panic because for the majority, the disease would feel like mild flu. He ruled out a nationwide shutdown to contain the virus, saying Pakistan's poor were dependent on daily incomes and would starve.

This deprived the country of a clear sense of direction. The federal government and provincial authorities - even those ruled by Khan's PTI party - each reacted differently. Sindh moved steadily towards a shutdown, while others enacted piecemeal measures like school closures and shortened shopping hours. There was no nationwide effort to urgently equip hospitals and front-line healthcare providers. There was not even a clear, mass messaging campaign launched by the authorities.

Pakistan's powerful military was left with no option but to make its presence publicly felt. On March 23, Pakistan's national day, chief spokesman Major General Babar Iftikhar announced troops would be deployed across the country in response to calls for assistance from the provincial authorities.

This was a clear signal that the establishment was losing patience with Khan's refusal to provide responsible leadership when the country most needed it. At a press conference on March 24, several TV anchors humiliated the prime minister.

Instead of accepting the counsel of the military, which helped usher his government into power in August 2018, Khan responded to criticism with obstinacy.

Addressing a video conference of parliamentary party leaders called by the opposition on March 25, Khan opposed moves by the Sindh government to enforce a province-wide shutdown, thereby stymying any matching measures in the other provinces, where his Pakistan Tehreek-e-Insaf party and their allies hold power.

The resultant leadership vacuum was exploited by populist clerics, whose refusal to cancel congregational prayers last Friday and other religious gatherings planted viral time bombs which began to detonate across the country, setting Pakistan on the path to a massive outbreak.

Again, Khan took to the airwaves on March 31, amid expectations that he would finally grab the bull by the horns. Instead, the prime minister insisted that Pakistan's youthful demographic would save it from the fate of other infected countries, and questioned the effectiveness of a lockdown.

The military had had enough. Another video conference of federal and provincial leaders was held on April 1 with army chief of staff General Qamar Javed Bajwa attending in combat fatigues, rather than usual dress uniform. In the official video of the event, he silently frowned at the federal cabinet.

Afterwards, Planning Minister Asad Umar, rather than Khan, announced that the varying restrictions on public movement introduced by the federal and provincial authorities in the second half of March would be extended until April 14, and the military announced that Lieutenant General Hamood Khan will be in charge of its command and control apparatus would oversee the state's response to the pandemic.

The ramifications of the all-powerful military's intervention could be dire for Khan's administration, once Pakistan has overcome the pandemic. Tired of the government's poor governance, in particular its mishandling of the economy, the military reportedly reached out to opposition party leaders last autumn. An increasingly public conversation among opposition politicians on how to go about removing Khan has ensued, fuelled by the subsequent release from jail of ailing former Prime Minister Nawaz Sharif on medical grounds.

Since then, the Pakistani news media has been rife with speculation about the longevity of Khan's administration. Until the coronavirus spread from Iran, eminent analysts generally felt that Bajwa was prepared to give Khan time to improve his government's performance.

That view has shifted markedly since the military was forced by Khan's ineptitude to take control of Pakistan's emergency response to the pandemic. Veteran Urdu language columnist Suhail Warraich, one of a handful of analysts renowned for accurately predicting the demise of governments, on Monday wrote that Khan has until June to get his administration's act together and mend fences with the opposition, failing which, violent political change may follow.

That "message" should be viewed as a warning that the military is in no mood to shoulder the blame for Khan's shortcomings. With Pakistan's very future at stake, the trajectory of the pandemic and his political career may well prove inseparable.

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