ISTANBUL — The United States ambassador to Turkey “went blond” this week in a post on Instagram that poked fun at the mayor of Ankara, Turkey’s capital, who had made sexist remarks about an American government spokeswoman on Twitter, calling her a “stupid blonde.”

Ambassador John R. Bass, who has dark hair, posted a digitally altered picture of himself with reddish-blond hair on his Instagram account on Thursday. The caption said, “American diplomats: we’re all blonde.”

On Wednesday, the mayor, Melih Gokcek, posted a picture on his Twitter account of the Baltimore police forcibly subduing a looter during the recent unrest there. He criticized Marie Harf, a spokeswoman for the State Department, for her “silence” after she had heavily chastised Turkey for its use of police force during antigovernment protests in 2013.

His Twitter post said, “Where are you, stupid blonde, who accused Turkish police of using disproportionate force?”