The embattled president of Pakistan, Asif Ali Zardari, on Tuesday used a speech on the fourth anniversary of the assassination of his wife, former prime minister Benazir Bhutto, to issue a firm challenge to those within the unstable south Asian nation who wish to unseat him.

The 56-year-old president told tens of thousands of people gathered at the Bhutto family shrine at Garhi Khuda Baksh in the southern Sindh province that the best way to pay tribute to his late wife, killed while campaigning in elections in 2007, was "to defend and protect democracy and democratic institutions in the country and foil all conspiracies against it".

The speech was Zardari's first public appearance since returning last week from Dubai where he had been receiving medical treatment for a suspected minor stroke and comes amid a welter of speculation that Pakistan's powerful military, which has ruled the country for much of its 64-year independent existence, is about to step in.

Zardari told the crowd that Bhutto's assassins "may have succeeded in eliminating her physically but [her] ideas and ideals … shall never be killed".

Relations between Zardari, who became president in the wake of his wife's death, and the military have always been tense but have deteriorated significantly in recent months. Senior officers believe Zardari or close aides penned a leaked unsigned – and unauthenticated – memo appealing to Washington for aid in heading off a military coup earlier this year. Hearings into the affair are being held by Pakistan's supreme court and could seriously destabilise the government.

Aides of Zardari privately claim the senior judiciary are acting in concert with senior military officers to force the president out. In a jibe at judges, Zardari raised the unsolved case of his wife's assassination in his speech.

Both elected and military officials have appeared to back away from confrontation in recent days however. General Ashfaq Kayani, the chief of army staff and the most senior soldier in the country, has, via a military spokesman, denied any intention to mount a coup.

On Monday Yusuf Raza Gilani, the prime minister, denied domestic media reports that he was planning to sack both Kayani and the head of the main Pakistani military spy service, the ISI, saying the military supported democracy.

One senior official in the ruling Pakistan People's party, founded by Benazir Bhutto's father, said on Tuesday that there was no question of the president resigning, whatever the pressure.

"He's a fighter. He's not going anywhere," the official said.

Zardari is deeply unpopular in Pakistan where he is blamed for failing to contain violent extremism, take measures to improve a corrupt and inefficient bureaucracy or act to halt rapid economic decline. Imran Khan, the cricketer turned conservative politician, has capitalised on this widespread disaffection. At least 100,000 people demonstrated their support for his Tehrik-e-Insaaf (Movement for Justice) party at a weekend rally in Karachi that cements his standing as a serious political force and increases pressure on the government. However, Khan will have to contest with the power of the Bhutto name, which though diminishing remains strong in Pakistan.

The introduction of Bilawal Bhutto – the political crown prince of the dynasty – to voters has been accelerated since the illness of his father. In an article published in a local newspaper on Monday, the 23-year-old Oxford graduate called on his countrymen to "remain committed to the evolution of a democratic Pakistan and reject the calls for confrontation between institutions".

The instability in Pakistan comes at a bad time for Washington. America's own relations with the Pakistani military are at a low ebb after a series of crises in the last 12 months.