ISLAMABAD, Pakistan  Faced with desertions by his political supporters and the unsettling neutrality of the Pakistani military, President Pervez Musharraf of Pakistan is expected to resign in the next few days rather than face impeachment, Pakistani politicians and Western diplomats said Thursday.

His departure from office seems likely to unleash new instability in the country as the two main parties in the civilian government jockey for his share of power. It would also remove from the political stage the man who has served as the Bush administration’s main ally here for the last eight years.

The details of how Mr. Musharraf would exit, and whether he would be able to stay in Pakistan or would seek residency abroad, are now under discussion between representatives of Mr. Musharraf and the governing coalition, the politicians said.

Mr. Musharraf would probably leave in the “next 72 hours,” Sheik Mansoor Ahmed, a senior official of the Pakistan Peoples Party, the major party in the coalition, said Thursday.