Mr. Gration, a former Air Force pilot and general who had served as a campaign adviser to Mr. Obama, said the ambassadorship to Kenya was his “dream job.” But since he got here in May 2011 — and even before that — Mr. Gration has been a bit of a lightning rod. Before his posting to Kenya, he served as Mr. Obama’s special envoy for Sudan and was routinely criticized by advocacy groups as being too conciliatory toward Sudan’s president, Omar Hassan al-Bashir, who has been indicted by the International Criminal Court on genocide charges for massacres in Darfur.

Mr. Gration seemed to slip up when he told The Washington Post in 2009, while discussing his strategy for Sudan: “We’ve got to think about giving out cookies. Kids, countries — they react to gold stars, smiley faces, handshakes, agreements, talk, engagement.” Some Sudan analysts, though, praised him for trying to nudge Sudan toward compromise, saying a new approach was needed to break through years of poisonous mistrust.

In Kenya, many of his underlings at the American Embassy said he was remote and imperial. He also did not seem to be engaged in Kenyan politics as the country heads into one of the most anticipated presidential elections in its history, the first since 2007, when the country exploded in ethnic violence. But some State Department and embassy staff members said they were reluctant to press their criticisms of him because of his close ties to the president.

People familiar with the disputes confirmed reports on Friday that Mr. Gration preferred to use Gmail for official business and set up private offices in his residence — and an embassy bathroom — to work outside the purview of the embassy staff.