An antiterrorism court in Islamabad has ordered former Pakistani military ruler Pervez Musharraf to be remanded in custody for two weeks.
Musharraf appeared before the court on April 20 over allegations that he illegally dismissed and detained several judges in 2007, when he imposed emergency rule and suspended Pakistan's constitution.
Musharraf has called the charges "politically motivated."
Musharraf was taken into police custody after being arrested on April 19.
The judge ordered Musharraf be held in custody until his next court appearance on May 4.
Musharraf spokesman Mohammad Amjad said authorities had decided that he would be placed under house arrest at his residence in Islamabad.
The decision to allow Musharraf back to his farmhouse was reportedly made after the police said the ex-president would face “serious security threats” in jail.
Musharraf’s supporters and opponents gathered outside the courthouse, where he was brought amid tight security.
Dozens of protesting lawyers chanted “Down with Musharraf” and “Whoever is a friend of Musharraf is a traitor.”
Police formed a human chain to prevent the lawyers from getting closer to the ex-general.
Musharraf also faces separate charges related to the 2007 killings of former Prime Minister Benazir Bhutto and a Baluch rebel leader in 2006.
He has also been accused of treason over the suspension of the constitution and the emergency rule.
In March, he returned to Pakistan after four years of self-imposed exile to run in the May 11 general elections. However, he has been disqualified from running.
Musharraf took power in a bloodless military coup in 1999 and remained in office until 2008.
Nawaz Sharif, the elected prime minister Musharraf ousted, is now the front-runner in the election campaign.
Based on reporting by AFP, AP, Reuters, BBC, and dpa