Updated

The general who ruled Pakistan for nearly a decade before being forced to step down appeared on Saturday in front of an anti-terrorism court in Islamabad in connection with charges linked to his 2007 sacking and detention of a number of judges.

The hearing — the latest act in the drama surrounding Pervez Musharraf that erupted earlier this week — was to decide where he would be held while his case goes through the legal system.

Musharraf's lawyer, Malik Qamar Afzal, said the judge ruled that he would be given judicial remand, which means that he would be held in jail until the next hearing in the case on May 4. That was confirmed by a court official who did not want to be identified because he was not authorized to speak to the media.

Musharraf's legal team has been pushing for his estate on the edge of the capital to be declared a sub-jail under the Pakistani legal system, which would mean that he would essentially be held under house arrest.

On Saturday, Musharraf was brought to the Islamabad courthouse surrounded by heavy security as supporters and opponents gathered outside the court.

He was arrested the day before in a case related to his decision, while in power, to sack and detain the judges, including the country's chief justice, after declaring a state of emergency and suspending the constitution. The decision sparked widespread protests that eventually weakened his government so much that he was forced to call new elections and eventually step down.

A judge has said that decision amounts to terrorism, which is why the case was sent to an anti-terrorism court. Such courts are closed to the media and the public.

Musharraf returned to Pakistan last month from four years in self-imposed exile to make a political comeback and contest the May 11 election. But he was greeted with little popular support and was disqualified from running in the election. A judge on Thursday ordered his arrest.

That sparked a dramatic escape by Musharraf from court in a speeding vehicle after which he holed up in his heavily guarded house on the outskirts of Islamabad until he was taken into custody Friday morning.

Musharraf seized control of Pakistan in a coup in 1999 when he was army chief and spent nearly a decade in power before being forced to step down in 2008. He returned despite Taliban death threats and a raft of legal challenges.

His arrest is a significant act in a country where senior army officers have long seemed untouchable. The army is still considered the most powerful institution in Pakistan, but its aura of impunity has declined in recent years, especially in the face of an activist judiciary.

When Musharraf entered the court Saturday, he was surrounded by a phalanx of police and paramilitary Rangers. Pakistani lawyers in their traditional black suits and white shirts chanted: "Whoever is a friend of Musharraf is a traitor," while supporters shouted: "Love live Musharraf!"

Musharraf has described the allegations as politically motivated.

"These allegations are politically motivated, and I will fight them in the trial court, where the truth will eventually prevail," Musharraf said in a message posted on his Facebook page Friday after he was arrested.