Turkish Prime Minister Recep Tayyip Erdogan was received with mixed feelings in Cairo this week on the first leg of his Middle East tour.
While his criticism of Israel was accepted with enthusiasm, the Egyptian government and the Muslim Brotherhood were anxious to make it clear that they would decide their own policies independently.
Mr Erdogan's arrival in Cairo on Tuesday was the first visit of a Turkish leader to the Egyptian capital in 15 years.
The two large Muslim countries are traditional rivals for influence in the region and while the departure of former President Hosni Mubarak has reduced the tension, there is still a great deal of mutual suspicion. For outward appearances, Mr Erdogan was treated as an ally, greeted by interim Prime Minister Essam Sharaf and the head of the Supreme Council of the Armed Forces, Field Marshal Mohamed Tantawi, who is the de facto current leader of Egypt.
At the same time, the Egyptian government refused Turkish requests to have Mr Erdogan visit the focal point of the demonstrations, Tahrir Square in Cairo, and to cross over to the Gaza Strip. Senior Egyptian officials explained this was an indication that Egypt plans to pursue an independent policy, and is opposed to Turkish hegemony in the region.
Mr Erdogan even managed to fall foul of his ideological allies, the Muslim Brotherhood, who told him to mind his own business following an interview in which he extolled the virtues of a Turkish-style secular state.
The Turkish Prime Minister was on more stable ground when focusing on Israel and the storming of its embassy over the weekend. At the Arab League in Cairo, he was cheered when he said in a speech: "Israel's actions are endangering its own future, they are not acting like a normal state. I want to see the Palestinian flag over the United Nations headquarters in New York and over their capital, Jerusalem."
His speech came in the wake of further threats that Turkey would send its fleet to accompany a new flotilla to Gaza. Mr Erdogan said that Israel's boarding of the Mavi Marmara last year and the deaths of nine Turkish activists "were a cause for war".