President Abdurrahman Wahid moved today to consolidate his control over the country's restive military by dismissing the armed forces' chief spokesman, whose public comments had stoked rumors of a rift between the president and the troops.

But Wahid left in place the powerful former military commander, Gen. Wiranto, who now holds a top cabinet post as coordinating minister for political affairs and security. Speculation was rife for weeks that Wiranto, who is facing a human rights investigation for his role in the violence surrounding East Timor's independence vote, was about to be sacked. Even though he has stepped aside as armed forces commander, Wiranto is believed to wield considerable influence in the military through his handpicked replacement, Adm. A. S. Widodo.

Wahid did replace Maj. Gen. Sudrajat, the military spokesman and a Wiranto ally, who had openly contradicted the president on the need to declare martial law in the troubled province of Aceh, where troops are battling a separatist insurgency. Only recently, Sudrajat was quoted in the Indonesian newspaper Republika as saying that Wahid--who as president is commander in chief of the armed forces--did not have "the right to interfere in the affairs of the military."

In an interview last month, Sudrajat hinted that the military might need to pressure Wahid into permitting the army to crack down on the Acehnese separatists. "If there is no other way to preserve the constitution, our modality would not be by coup, in taking over the government," he said. "Our modality would be to go to the parliament and talk to the people. There won't be a formal coup."

Those and other comments were known to have astonished and angered members of Wahid's inner circle, who feared the military had never fully accepted the president's authority and might be planning a "creeping coup." Wahid gave no specific reason for Sudrajat's dismissal, saying only: "We need to replace officers who are not suitable."

The president and the military leadership have been consistently at odds over the army's demands for a freer hand in controlling the Aceh insurgency and a surge in sectarian violence in the Spice Islands that has left hundreds dead since the start of the Christmas season.

Sudrajat was replaced by Air Force Marshal Graito Usodo, marking the first time an air force officer has been chief military spokesman. Another air force officer, Ian Halim Perdanakusuma, was named head of military intelligence, a post that also had been traditionally filled by the army.

Having named Widodo, a naval officer, as armed forces commander, and a civilian, Juwono Sudarsono, as defense minister last October, Wahid appears to be trying to dilute the power of the army, which he considers a rival, by balancing the military leadership with officers from other service branches. When he was elected president last October, Wahid also spoke about the need to give additional resources to the navy to boost Indonesia's maritime capabilities.

Wahid accompanied today's military shifts with other appointments in the bureaucracy, as he attempted to put his stamp more firmly on the administration he inherited from B.J. Habibie, a protege of the former dictator Suharto. Wahid announced that the heads of the state oil company, Pertamina, and the stock market watchdog agency, Bapepam, also will be replaced.

Earlier this week, Wahid signed a presidential decree replacing Glenn Yusuf as chairman of the Indonesian Bank Restructuring Agency, or IBRA, which is charged with recapitalizing the country's crippled banking sector and which now controls more than $100 billion in assets taken over from bankrupt companies. Officials said Yusuf was replaced because Wahid wanted the assets disposed of more quickly.

These moves came during a visit here by Singaporean Prime Minister Goh Chok Tong, who is leading a large delegation of businessmen. Wahid is eager to show Indonesia's tiny but wealthy neighbor that the months of political upheaval are now past and that this country is once again a good place to invest.