ISLAMABAD — In his latest setback since returning from exile last month, Pakistan's former military ruler Pervez Musharraf quickly fled a courtroom Thursday after a judge revoked his bail and ordered his arrest. Musharraf and his security detail pushed through a large crowd outside the Islamabad High Court after the hearing, then sped away in a convoy of SUVs as lawyers chased behind, shouting insults. The scene of Musharraf running before the law, unimaginable just a few years ago at the height of his power, was the latest twist in his quixotic bid to return to Pakistani politics, which has been dogged by a series of mishaps and humiliations. It could also presage a wider clash. Never before has a retired army chief faced imprisonment in Pakistan, and analysts said the move against Musharraf could open a new rift between the courts and the military. After fleeing Thursday, Musharraf drove to his luxury villa on the outskirts of the capital, which is protected by high walls, armed guard posts and a contingent of retired and serving soldiers, officials said. That bolstered security setup is a reflection of Taliban threats to kill the former general. But for now, the imminent danger to Musharraf, who ruled Pakistan between 1999 and 2008, stems from the courts. At Thursday's hearing, the High Court judge, Shaukat Aziz Siddiqui, refused to extend Musharraf's bail in a case focusing on his controversial decision to fire and imprison the country's top judges when he imposed emergency rule in November 2007. Resentment toward the former army chief and president still runs deep in the judiciary, which was at the center of the protest movement that led to his ouster in 2008. On Thursday evening, the court demanded to know why the police had failed to arrest Musharraf as he left the court, Pakistani television stations reported. A spokesman for Musharraf's party described the court order as “seemingly motivated by personal vendettas,” and hinted at the possibility of a looming clash with the military, warning that it could “result in unnecessary tension among the various pillars of state and possibly destabilize the country.” Musharraf's lawyers lodged an appeal with the Supreme Court, which said it would hear the case Friday. One widely offered possibility was that the Supreme Court could declare Musharraf's villa a “sub-jail,” and place him under house arrest there. The court drama represents the low point of a troubled homecoming for the swaggering commando general, who had vowed to “take the country out of darkness” after returning from four years of self-imposed exile in Dubai, London and the United States. Officials in Musharraf's party denied that he was in any way a fugitive. “No attempt was made to arrest Musharraf,” Muhammad Amjad Chaudhry, the senior party leader, said. “No police officer asked him to surrender. Musharraf returned to his residence from the court. He is not in hiding.” — Agencies