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 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 Musharraf and the governing coalition, the politicians said.

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.

What remained to be worked out were guarantees for Musharraf's physical safety if he stayed in Pakistan, or where he would go into exile. Among the places that Musharraf is said to favor if he goes abroad are Dubai, Turkey, the United Kingdom or the United States, though his strong preference is to stay in Pakistan, Pakistani politicians familiar with the negotiations said.

Musharraf also wants immunity from prosecution for any impeachable deeds, which the governing coalition appears willing to grant if he steps down, they said.

The question of who would succeed Musharraf is a subject of almost as much maneuvering within the coalition as the plan to get rid of him.