A Pakistani court put ex-military leader Pervez Musharraf under arrest in his plush villa on Friday in an unprecedented move against a former army chief of staff.
The Islamabad High Court ordered his arrest on Thursday for sacking senior judges while in power, the latest humiliating blow to the man who returned to Pakistan from four years in self-imposed exile to contest elections.
It is the first arrest of any former chief of the Pakistani army, considered the most powerful institution in the nuclear-armed country, which has been ruled for around half its 66-year existence by the military.
The 69-year-old is now officially under detention in his heavily fortified home in a smart suburb of the capital, where media were massed outside and police barricaded the street, an AFP reporter said.
Musharraf took to Facebook to say he would fight the charges.
"These allegations are politically motivated and I will fight them in the trial court, where the truth will eventually prevail," he said in a statement.
Live TV footage showed Musharraf arriving dressed in a traditional shalwar kamiz and waistcoat surrounded by police and paramilitary.
"General Musharraf has been sent on a two-day judicial remand and he will stay at his farmhouse," said a spokesman for his All Pakistan Muslim League (APML) party, now expected to win no seats when the country goes to the polls on May 11.
An official at the magistrates court in Islamabad confirmed the arrest order over for sacking judges when Musharraf imposed emergency rule in November 2007, a move which hastened his downfall.
APML spokesman Muhammad Amjad denied media reports that he had been arrested prior to going to court and said he had been ordered to re-appear before an anti-terrorism court in Rawalpindi in two days' time.
"Musharraf himself surrendered before the court," Amjad said.
"We will now file an application for post-arrest bail in the trial court," his lawyer Ahmad Raza Kasuri told AFP.
Commentators say it is clear that Musharraf is finished politically. He was on Tuesday disqualified from contesting the elections, to mark the first democratic transition of power after a civilian government completes a full-term in office.
Lawyers have also petitioned Pakistan's top court to try him for treason for imposing emergency law, punishable by death or life in prison, although it will have to be the state that initiates any trial.
He also faces charges of conspiracy to murder opposition leader Benazir Bhutto in 2007 and over the death of a rebel leader during a 2006 military operation.
Political analyst Hasan Askari warned that any arrest or trial risked overshadowing the elections, set to mark the first democratic transition of power after a civilian government has completed a full term.
"The judiciary is overdoing it. It should show some restraint.... It can grant bail now and take up the case after the election which should be our primary objective," he told AFP.
Musharraf's supporters say the arrest order was nothing more than a settling of scores for his dismissal of judges nearly six years ago.
On Thursday, Judge Shaukat Aziz Siddiqui said Musharraf had "spread fear in the society, insecurity amongst the judicial officers, alarm in the lawyers' community and terror throughout Pakistan".
He likened the sacking judges to "an act of terrorism".
Musharraf seized power in a bloodless coup, which was widely welcomed at the time in Pakistan, but he was forced out and threatened with impeachment in 2008.
The elected prime minister he ousted, Nawaz Sharif, is now the front-runner in the general election campaign.