ISLAMABAD, Pakistan — When the former military ruler Pervez Musharraf ended his years of exile last month, it was with a vision of himself as a political savior, returning in the nick of time to save Pakistan from chaos.

Instead, he contributed a new and bizarre chapter to the country’s political turmoil on Thursday, fleeing the halls of the High Court after a judge ordered his arrest. Speeding away in a convoy of black S.U.V.'s as a crowd of lawyers mocked him, he hurried to his fortress compound outside the capital, where he was declared under house arrest.

Early Friday, the police escorted Mr. Musharraf from his house to a court in central Islamabad where a magistrate formally charged him. Television pictures showed him saluting briefly as he entered his S.U.V., before returning once again to his Islamabad home. Television stations reported that Mr. Musarraf was due to appear in anti-terrorism court in two days, but it was not clear if that meant Sunday or Monday.

Less than five years after wielding absolute power, the retired four-star general has become the latest example of the Pakistani judiciary’s increasing willingness to pursue previously untouchable levels of society — even to the top ranks of the powerful military.