Mr. Musharraf, who has been charged with treason, was admitted Jan. 2 to the Armed Forces Institute of Cardiology after he complained of sudden heart trouble while he was on the way to attend his trial.

This week, Mr. Musharraf was formally indicted on treason charges, an unprecedented development in the country’s history. No military ruler has ever been tried for treason or other abuses of power. The powerful military has traditionally maintained an overarching influence over the civilian government.

Mr. Musharraf is accused of subverting the Constitution in 2007 when he fired top members of the judiciary to stem a growing opposition movement. But the move backfired as Mr. Musharraf’s political party lost the 2008 national elections in a thumping defeat. Mr. Musharraf later resigned, under the threat of impeachment, opting for self-imposed exile in London and Dubai, in the United Arab Emirates.

In 2013, Mr. Musharraf returned to the country to revive his political fortunes and participate in general elections. But he was barred from taking part in the elections by the courts, and his political party, the All Pakistan Muslim League, failed to gain any traction.

To add to his woes, Mr. Musharraf found himself facing several criminal cases related to his time in power, the treason charges being the most serious as they carry the death penalty if he is convicted.