By Friday Mr. Kerry was faced with the task of trying to discourage another outburst from the Turks and salvaging some chance of an improvement in ties between Turkey and Israel — the first a moderate Muslim-majority nation and important NATO ally, and the other the principal United States ally in the Middle East.

The Americans’ sternest message to the Turks was conveyed before Mr. Kerry’s plane even landed by a senior State Department official who spoke under ground rules that he not be identified by name.“This was particularly offensive,” the official said, referring to Mr. Erdogan’s comments. “It complicates our ability to do all of the things that we want to do together.”

Once in Ankara, Mr. Kerry initially approached the issue somewhat indirectly. Noting that he had attended a memorial event earlier in the day for a Turkish security guard who had been killed trying to stop suicide bomber at the American Embassy, Mr. Kerry said that this selflessness should inspire a “spirit of tolerance.”

“And that,” Mr. Kerry added, “includes all of the public statements made by all leaders.”

But in response to a question at a news conference with Foreign Minister Ahmet Davutoglu, Mr. Kerry was more direct.

“Obviously, we not only disagree with it. We found it objectionable,” Mr. Kerry said of Mr. Erdogan’s statement, noting that he planned to raise the matter Friday evening with the prime minister. The comments by Mr. Davutoglu suggested that it might not be an easy discussion.