ISTANBUL, Turkey  Prime Minister Recep Tayyip Erdogan of Turkey flew home Friday to a hero’s welcome from some Turks, and a more muted response from others, after walking off the stage at the World Economic Forum in Davos, Switzerland, following an angry exchange over the Gaza war with Israeli President Shimon Peres.

Mr. Erdogan’s decision to leave the debate Thursday had all the overtones of a diplomatic incident, ruffling relations between Israel and a Muslim ally that seeks an important role as a mediator in Middle East peace efforts.

In Davos, Mr. Erdogan apparently became incensed during a panel discussion after a moderator curtailed his response to remarks by Mr. Peres on the recent Israeli military campaign in Gaza. “When it comes to killing, you know well how to kill,” he told Mr. Peres before scooping up his papers and leaving the stage. Commentators in Turkey said Mr. Erdogan appeared provoked by the fact that Mr. Peres was pointing his finger at Mr. Erdogan and raising his voice in an unusually aggressive manner as the two men argued.

According to Turkey’s semiofficial Anatolian News Agency, Mr. Peres called Mr. Erdogan by telephone five minutes after the walkout to apologize for any misunderstanding, saying that his remarks about Israel’s Gaza offensive had not been directed at the prime minister personally. In Jerusalem, a spokeswoman for Mr. Peres, Meital Jaslovitz, described the telephone conversation as “positive.” But, she said on Friday, there was no apology from Mr. Peres, contrary to the Turkish news agency report.