Former Pakistan president Pervez Musharraf was arrested Friday at his farmhouse in a case related to his decision to impose a house arrest order on judges in March 2007 during his "emergency rule."

Musharraf had managed a dramatic escape from an Islamabad High Court room Thursday, after a judge cancelled his bail and issued an arrest warrant against him. He was arrested from his farmhouse in Chak Shahzad on the outskirts of Islamabad, where he was holed up after fleeing from the court premises with the help of his private body guards.

According to an Associated Press report, Musharraf was presented before a judicial magistrate at the Islamabad District Court on Friday immediately after his arrest, and the magistrate Muhammad Abbas Shah granted a two-day “transit remand” to the former military ruler.

The magistrate also directed police to produce Musharraf in an antiterrorism court in two days, and the Islamabad High Court Thursday revoked his bail plea and directed authorities to charge him under the Anti-Terrorism Act for his actions during the 2007 "emergency rule."

Local television footage showed the former military strongman being taken to the magistrate’s chamber amid high security as he appeared visibly shaken. However, according to the police officials he was driven back to his farmhouse where he will be kept under house arrest. Police said the former military general will not be sent to prison because he faces death threats.

In a Facebook post after his arrest, Musharraf lashed out against allegations, claiming they were politically motivated.

"These allegations are politically motivated, and I will fight them in the trial court, where the truth will eventually prevail," Musharraf wrote in the Facebook post.

The 69-year-old former president is facing trial over his decision to detain more than 60 judges under house arrest during the 2007 emergency rule, when he was in power.

If found guilty and sentenced to jail, Musharraf would become the first army chief to be imprisoned in the country’s 65-year history.

Musharraf can appeal to the Supreme Court against the judgment.

Musharraf arrived in Pakistan in March last week after ending four years of self-imposed exile and defying death threats to contest in the May general elections. The retired general is battling a slew of court cases since his arrival.

Earlier this week, Musharraf was disqualified from contesting in the general election, effectively ending his political ambitions. He is also barred by the courts from leaving the country.

Musharraf is also battling several other cases, including conspiracy to murder opposition leader Benazir Bhutto in 2007.

In another case Wednesday, Pakistan’s caretaker government sought more time from the Supreme Court to decide whether it is within its mandate to initiate a treason case against the former military ruler, Dawn newspaper reported.

In addition, Musharraf is charged for his alleged involvement in the killing of a Baloch tribal chieftain.

The former army chief became president following a bloodless military coup in 1999 and ruled the country until August 2008. He resigned following a threat of impeachment by a newly elected parliament and opted for an exile to escape legal charges.