Pakistani police have arrested former President Pervez Musharraf and presented him in court.
A district court judge ordered General Musharraf to be held under house arrest for two days.
TV images showed the former leader being taken into the Islamabad court amid heavy security.
On Thursday a court ordered his arrest over an attempt to impose house arrest on judges in March 2007.
Police officer Mohammed Khalid said Gen Musharraf was arrested overnight at his home on the outskirts of Islamabad.
Last month Gen Musharraf returned from years of self-imposed exile hoping to lead his All Pakistan Muslim League (APML) party into the general election next month.
But earlier this week his candidacy was rejected in Chitral, one of four seats he had applied to contest.
Gen Musharraf had already failed in an attempt to stand in three other seats.
The case for which he has been arrested relates to his controversial decision to dismiss judges – including Chief Justice Mohammad Iftikhar Chaudhry – when he imposed emergency rule in 2007.
He also faces several other criminal cases – including treason charges – and had been trying to stave off arrest ever since he returned.
The Pakistani Taliban have also vowed to assassinate the former president, who seized power in a 1999 coup.