Media playback is unsupported on your device Media caption "High drama and farce" as Pervez Musharraf speeds away from a court which ordered his arrest, as Orla Guerin reports

A court has ordered the arrest of Gen Pervez Musharraf over his attempt when Pakistan's military ruler to impose house arrest on judges in March 2007.

Mr Musharraf was present at the Islamabad High Court when the judges issued the order. He had been seeking to extend bail in the case.

Police present made no attempt to arrest him as he left the court.

A statement from his office described the court order as "ill-conceived and unwarranted judicial activism".

It said that the order was "seemingly motivated by personal vendettas" since Mr Musharraf's return to Pakistan to participate in general elections in May.

An appeal is being made to the Supreme Court, the statement said.

Media playback is unsupported on your device Media caption Mr Musharraf's barrister criticised the arrest order

The former general immediately left the court after the arrest order and drove away escorted by his security detail.

The case relates to Mr Musharraf's 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.

The BBC's Orla Guerin in Islamabad says that his departure from the court - despite the presence of a large number of police - was a moment of high drama and farce.

There has been no sign of an attempt by the authorities to arrest Mr Musharraf at the house near Islamabad where he is now staying.

Normally police handcuff individuals within court premises immediately after an arrest order has been issued but no effort was made to restrain him.

Political woes

He returned from years of self-imposed exile last month hoping to lead his All Pakistan Muslim League (APML) party into the general election next month.

Analysis Arrest warrants against former military ruler Pervez Musharraf are seen here as a political distraction ahead of general elections in May. Analysts are voicing fears it may divert attention from what promises to be the country's first civilian-to-civilian democratic transition. It is certainly going to put pressure on the interim government, which will now have to ensure that this high-profile court case does not interfere with the vote. It also puts the country's powerful military in a difficult spot. It does not want to be seen to be interventionist, but would surely be concerned about the fate of one of its former chiefs. If he is arrested, the government may decide to detain him at his residence instead of sending him to prison. It would be the first time a former military ruler has met such a fate. But to many it would also make Mr Musharraf look like a victim, especially when he was barred from standing in elections just days ago.

But earlier this week his candidacy was rejected in Chitral, one of four seats he had applied to contest. He had already failed in an attempt to stand in three other seats. His legal team plan to appeal against that decision.

He is embroiled in a series of legal battles and has been attempting 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.

Among the cases he faces are his alleged failure to provide adequate security to opposition leader Benazir Bhutto at the time of her assassination in 2007 and the death of a tribal leader from Balochistan.

The statement from his office on Thursday called on the court to cease pursuing him and to abide by the rule of law - "the absence of which will cause mockery of the nation... unnecessary tension amongst the various pillars of state and possibly destabilize the country".

Mr Musharraf has already been barred by a court from leaving the country.

Many analysts believe that the authorities would not welcome his arrest at such a politically sensitive time.

The BBC's M Ilyas Khan in Islamabad points out that Pakistan's powerful military, of which he was the head until 2007, has not intervened to prevent his political fall.

But while his future appears increasingly bleak, few believe the military would allow a former chief to be thrown in jail or assassinated by militants, he adds.