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.
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.
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.
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.