(Adds Musharraf spokesman)
By Mehreen Zahra-Malik
ISLAMABAD, April 18 (Reuters) - Former President Pervez Musharraf fled a courtroom on Thursday after judges ordered his arrest to answer allegations he committed treason in 2007, an ignominious retreat for a man who once dominated Pakistan and had hoped to revive his political fortunes.
Pakistani television broadcast footage of Musharraf dashing from Islamabad High Court in a black SUV as several lawyers made half-hearted attempts to pursue his vehicle - a scene that would have been unthinkable when Musharraf was at the height of his powers.
It was another blow to his hopes of resurrecting his political career after election officers barred him from standing at next month's general elections, in part due to the various legal challenges he faces. The bid had garnered widespread popular scorn.
Musharraf retreated to a farm in an exclusive residential estate on the outskirts of Islamabad where police set up a cordon restricting access to the area. It was unclear whether the officers were preparing to detain him.
As police moved to seal off access, Mohammad Amjad, Musharraf's spokesman, called a news conference to announce that his lawyers would petition the Supreme Court on Friday to withdraw the order.
"We will file an appeal against the arrest order in the Supreme Court tomorrow," Amjad said. He added that Musharraf was "composed and in good spirits".
The high court's order pushed Pakistan's increasingly audacious judiciary into uncharted territory, challenging a long-standing, unwritten rule that the top ranks of the army, which ruled Pakistan for decades, are untouchable.
Despite Taliban death threats and a host of legal challenges, Musharraf returned from almost four years of self-imposed exile in London and Dubai last month in the hope of winning a seat in the National Assembly at the May 11 polls.
But his arrival has placed him at the mercy of judges whose memories are still raw of the showdown in 2007 when he sacked the chief justice, placed his colleagues under house arrest, and lawyers fought running battles with police.
On Thursday, a judge ordered his arrest in connection with allegations he committed treason when he declared emergency rule during his 2007 confrontation with the judges, a move his opponents believe violated the constitution.
Judges piled more pressure on Musharraf later on Thursday when they summoned the head of Islamabad police to explain how he was able to flee the court without being detained.
Some commentators believe that it is unlikely Musharraf, who seized power in a 1999 coup and resigned in 2008, will be arrested since the military would be unlikely to tolerate such a humiliating spectacle for a retired chief.
"I don't think the military establishment would support any move against him," said Mehdi Hasan, a newspaper columnist.
The military made no immediate comment on the arrest order.
Although Musharraf's legal battles have provided an electrifying sideshow in the election race, he commands scant popular support and the outcome of the drama is unlikely to have much impact on the final results.
Former Prime Minister Nawaz Sharif, the man Musharraf ousted in a coup in 1999, is seen as the frontrunner to become prime minister.
Pakistan's military has ruled the nation for more than half of its 66-year history, through coups or from behind the scenes. It sets foreign and security policy even when civilian administrations are in power.
Pakistan's judiciary has, however, taken an increasingly assertive stance in recent years in confrontations with both the government and the army, and the arrest order against a former army chief is sure to rankle some in the military.
Musharraf's decision to return has mystified many Pakistanis, with commentators questioning whether he misjudged the degree of popular support he might be able to muster.
Musharraf faces charges of failing to provide adequate security for former prime minister Benazir Bhutto before she was assassinated in late 2007.
He also faces accusations in connection with the death of a separatist leader in the southwestern province of Baluchistan. He denies any wrongdoing. (Additional reporting by Mubasher Bukhari and Matthew Green; Editing by Nick Macfie and Sonya Hepinstall)