A special Pakistani court indicted former military ruler Pervez Musharraf on five counts of high treason today, a charge which potentially carries the death penalty and comes as a sharp blow to the country's powerful military.

The development is the first time that an acting or former army chief has been indicted for treason in Pakistan, where the military has taken power in three coups since the country was founded in 1947.

The indictment - the latest high drama in a series of legal cases Musharraf has faced since returning to Pakistan a little over a year ago - also showcases the tensions between the civilian government which initiated the case and the military, which has generally been above the law.

Musharraf, who appeared in court in Islamabad today for only the second time in the lengthy court proceedings that began in December, pleaded not guilty to all five counts and delivered a nearly 30-minute defence of his time in office.

The former general, who has been in hospital in the nearby city of Rawalpindi after complaining of chest pains on his way to a court session in January, said he was appearing at the hearing against the advice of his medical team.

"I am being called a traitor," he said. "I put the country on the path of progress after 1999 when the country was being called a failed and a defaulted state."

"Is this the way to reward someone for being loyal to the country and for loving the country?" he asked the court.

If convicted, Musharraf could face the death penalty but it remains unclear whether the trial will ever get that far. Musharraf's lawyers have been requesting that he be allowed to leave the country for medical treatment.

Today, his lawyer, Farogh Naseem, again requested that Musharraf be allowed to leave Pakistan, this time to visit his ailing mother in Dubai. Mr Naseem promised that his client would return to face further court proceedings.

"The mother is dying, for God's sake," he said. "He will come back. He wants to face the trial. He wants his name to be cleared."

The prosecutor expressed sympathy for Musharraf, and while he did not say whether the former military ruler should be allowed to leave the country, he did not object either.

Musharraf took power in a 1999 coup but was forced to step down in 2008. The high treason case stems from his decision to suspend the constitution and detain a number of judges in 2007. The move backfired and led to widespread protests by the country's powerful legal community. Eventually, Musharraf was forced to step down and left the country soon after.

He returned to Pakistan in March after years in self-imposed exile, with the hope of running in the national election that was held in May. But he was disqualified from participating in the vote because of his actions while in power and has spent most of his time since battling legal cases.