John Kerry has spent much of this week shuttling between Middle Eastern capitals, trying to get Hamas and Israel to put down their guns. For his efforts, Kerry probably did not expect to be suspected of being an armed threat himself.

Yet that was what briefly happened on Tuesday, when Kerry was stopped by security guards as he entered Cairo's presidential palace to meet Egypt's president, Abdel Fatah al-Sisi. Footage shows America's top diplomat being "wanded" with a hand-held electronic scanner. It was a move that raised eyebrows among members of Kerry's travelling press corps, who said the US secretary of state was usually afforded every courtesy when on official business abroad.

The incident caused a small diplomatic kerfuffle, amid suspicion that Kerry had been purposefully humiliated in a show of Egyptian independence. But taken to task on Egyptian television, Sisi's spokesman, Ehab Badawy, shrugged it off as a "spontaneous" incident. "This security measure is very natural," said Badawy, "one that Egyptian officials abroad are subjected to, and a former foreign minister experienced it during his visit to the United States."

Egyptian foreign ministry officials have explained the incident as the act of a security team unfamiliar with dealing with foreign dignitaries.

Nevertheless, it marks Kerry's second embarrassment in Egypt in the space of a month. Kerry flew in to Egypt in late June, one day before a verdict was expected in the trial of three al-Jazeera journalists accused of endangering Egypt's national security. In a meeting with Sisi, Kerry explicitly raised their plight; that a guilty verdict was still reached hours later, despite Kerry confirming the return of US aid to Egypt, represented a slapdown for US diplomacy.

Still, Kerry's stubborn support for Egypt's regime appears undiminished. Following his "wanding" experience, Kerry continued to praise the new Egyptian government, despite widespread criticism of its year-long crackdown on dissent. "I want to thank the people of Egypt for transitioning to democracy," said Kerry.

• This article was amended on 26 July 2014 to correct the quotation from Ehab Badaway.