But what the West African military gives, it can take away.

In Guinea, mutinous soldiers last week aimed bazookas and rocket-propelled grenades at the bedroom of Mr. Condé, the country’s first democratically elected president. He escaped only because, as a precaution, he happened not to be sleeping there. Nearly 40 people have been arrested since.

Mr. Condé was elected in November after a lifetime dodging the country’s founding dictators, but after taking office he quickly angered the uniforms that have long controlled Guinea.

“Sure, there were officers who got used to pulling $40,000, $60,000 a month,” Mr. Condé told Radio France Internationale after the attack. “There was a bizarre $2 million fund I canceled. Obviously, there are some who are unhappy. But you can’t keep on killing the country.”

On Monday, his national communications council banned any media discussion of the attack on the president, a decision quickly denounced by Guinea’s press unions as crude censorship in a country with newfound democratic aspirations. The council’s president, Martine Condé (no relation to the president), said the ban was intended to promote “serenity” in a “country that is 70 percent illiterate,” but it was withdrawn Thursday after criticism at home and abroad.

In Niger, the new government of Mr. Issoufou, elected in February, made several arrests last week in connection with a coup plot, said a government official who was not authorized to speak publicly on the matter.

“There are still elements inside the army that think they can do a coup d’état and promise democracy, then fill up their pockets and go,” said the government official, dismissing the episode as “really minor.” He said that “documents” were discovered in connection with the coup plot, “a plan, the form of government.”

As in Guinea, the source of the trouble was disgruntled soldiers, the Niger government official said.