America's Embassy in Cairo on Tuesday posted a link to a clip of The Daily Show, the US political comedy programme, in which Jon Stewart, its host, criticised Mohamed Morsi, Egypt's president.
Stewart spoke out against Morsi's detention of Youssef for "insulting Egypt and Islam", telling viewers: "A democracy isn't a democracy if it only lasts up until someone makes fun of your hat."
The US embassy's tweet prompted a sharp response from the Twitter account for Mr Morsi's office. "It's inappropriate for a diplomatic mission to engage in such negative political propaganda," it said.
Mr Morsi's Freedom and Justice Party also weighed in, describing the post as "another undiplomatic and unwise move" and accusing the US embassy of "disregarding Egyptian law and culture".
The embassy briefly deactivated its Twitter page on Wednesday, but was ordered to restore it by the State Department in Washington. The tweet at the centre of the diplomatic flap had, however, been erased.
Victoria Nuland, a State Department spokesman, said at a press briefing on Wednesday afternoon that embassy officials had decided that "the decision to tweet it in the first place" was wrong, and that a review of social media procedures was now under way.
"We've had some glitches with the way the twitter feed has been managed," said Ms Nuland. "This is, regrettably, not the first time".
The embassy in Cairo was heavily criticised in September last year for using a tweet to reiterate a statement chiding the makers of an anti-Islamic film for trying to "hurt Muslim feelings". It was published as terrorists were attacking the US consulate in Benghazi, Libya.
Ms Nuland said that John Kerry, the Secretary of State, had raised concerns about the treatment of Youssef with senior Egyptian officials.