Media playback is unsupported on your device Media caption The BBC's Shahzeb Jillani says Mr Musharraf arrived under tight security

Former military ruler Pervez Musharraf has appeared in a Pakistani court for the first time on treason charges.

Security and health concerns had prevented him from attending earlier hearings, and he has been in hospital for more than a month.

Mr Musharraf is accused of unlawfully suspending the constitution and instituting emergency rule in 2007.

He is the first former military ruler to be tried in Pakistan, and faces the death penalty if found guilty.

Analysis Pervez Musharraf appeared healthy and fresh in his black Nehru jacket as he walked into the courtroom during a break. A few of his party workers applauded his arrival, and his lawyers hugged him. The security detail on the premises was nearly twice the size of the numbers that are normally present, and jammers were placed inside the courtroom. In a country where politicians have often been put on trial on one charge or another, Mr Musharraf is the first former army chief to face such a fate. He is also the first individual in Pakistan to face the charge of high treason. This makes the case a difficult one to handle, and the court is apparently treading cautiously. There are no precedents in the case, and therefore no set procedures. There are also fears of institutional tensions, because while some elements in the government and the judiciary want Mr Musharraf convicted, there are those in the powerful military who fear the case may expand in scope and put military into an awkward light.

The 70-year-old arrived for the hearing at the National Library in Islamabad in a heavily protected convoy.

Mr Musharraf's lawyer, Ahmed Raza Qasuri, told the BBC that the ex-leader was only in court for 20 minutes.

Mr Musharraf's legal team argue that he should be tried in a military court, not a civilian one.

The BBC's Shahzeb Jillani in Pakistan says the court has not charged Mr Musharraf and will decide on Friday whether it has the jurisdiction to try a former army chief.

He also faces further charges of murder and restricting the judiciary.

Mr Musharraf says all the accusations against him are politically motivated.

As president from 2001 to 2008, he was one of Pakistan's longest-serving rulers.

He was in self-imposed exile, mostly in the UK , from 2008 onwards, before returning to Pakistan in March 2013.