By Jonathan Head
BBC News, Istanbul
The Israeli commando raid on a Turkish ship carrying aid to Gaza has seen Turkey in the role of mouthpiece for the fury of the Muslim world. But once this week's passions have cooled, it may be in Turkey's interests to repair relations with Israel.
Tens of thousands attended the funeral service for those killed in the raid
Most neighbourhoods of Istanbul look much the same, with their narrow streets and jumble of nondescript concrete blocks, usually marching down a steep hill with perhaps a glimpse of the Bosphorus or the Golden Horn at the end.
But in Fatih, you immediately feel you are somewhere different, somewhere closer to Arabia.
The women are clad in black from head to toe, their faces often covered, and the men wear beards and baggy trousers.
This is where the IHH (the Foundation for Human Rights and Freedoms and Humanitarian Relief) is based, the Islamic charity which largely funded the aid flotilla that tried to break the Gaza blockade this week.
Its inspiration is unapologetically religious but the IHH insists its mission is purely humanitarian, despite Israeli claims that it supports the armed activities of Hamas.
It is certainly rich. When it found few ship-owners willing to risk chartering their vessels for the risky voyage to Gaza, it bought a 15-year-old ferry, the Mavi Marmara, for more than $1m (£686,000).
Shocked by loss
It also has some powerful backers in the governing party, the AKP.
One of the party's MPs sits on the IHH board. Three years ago, it was given the Parliament Award of Honour - one of the country's highest decorations - for its overseas charity work.
Nine activists were killed on board the Mavi Marmara
Deputy Prime Minister Bulent Arinc said he saluted and congratulated the IHH. The government openly backed its mission, although it disclaimed any official links.
So when Israeli forces boarded the Mavi Marmara, the government found itself at the centre of the storm.
Nine of its citizens were shot dead, 19 injured, and nearly 400 taken into custody.
The loss was so shocking that the country rallied together to condemn Israel.
There were no voices of dissent questioning why the government had allowed itself to be associated so closely with a charity whose funding is opaque, and whose activists, notwithstanding the charity's impressive record of humanitarian work, sometimes embrace the militant language of jihad.
Had Israel not made such a hash of its boarding operation, there might have been a little less public enthusiasm in Turkey for the IHH and its blockade-busting mission.
Turkey is famously a country where you can drink, dress lightly and party, especially in Istanbul and the Aegean coast.
Rising religious piety in Turkey has coincided with a heightened awareness of its place in the world
The population is almost entirely Muslim, but very diverse in the way they practice their faith. Some Turks follow a form of Islam as strict as any in the Middle East, and more than half the population considers itself to be religiously conservative.
That explains the electoral success over the past decade of the AKP, as the grip of the old, secular ruling class of bureaucrats and generals has weakened.
Much of Turkey's new wealth is being made by a new, provincial business class, many of them devout Muslims. They vote AKP, and some donate generously to the IHH.
Rising religious piety in Turkey has coincided with a heightened awareness of its place in the world.
This used to be a very inward-looking country, focused on its own volatile politics, its foreign relations dictated by its Cold War alliance with the United States.
That has changed under the AKP, which has energetically repaired relations with its once hostile neighbours, Syria, Iraq, Iran and Russia.
AKP politicians often use the language of Islamic brotherhood to build ties with other Muslim countries, although the real motivations are usually trade and business.
Turkey's foreign minister aims to have "zero problems" with its neighbours
This has inevitably diminished the old alliance with Israel.
Emotions stirred by the plight of the Palestinians have only accelerated that process. Prime Minister Tayyip Erdogan is genuinely affronted by the blockade of Gaza.
But Turkey aspires to be a lot more than just another voice for Muslim grievances.
Under its dynamic Foreign Minister, Ahmet Davutoglu, it is trying to be a new regional, perhaps even a global power, to sit alongside China, India and Brazil.
Mr Davutoglu has ambitions to play a leading role in resolving conflicts in the Balkans, in Somalia, in Afghanistan.
He has designed a new energy alliance with Russia and, together with Brazil, he has defied Washington to negotiate a deal with Iran on its nuclear programme.
There is talk here of neo-Ottomanism, a revival at least of the imperial influence, if not the power, it once enjoyed in the region.
And with that comes responsibility. Responsibility to balance populist, emotional issues like the Palestinians with hard-headed interests, like trade and military ties.
AKP politicians have explained that, in their brave new world, the relationship with Israel just is not that important any more.
That is probably true. But once the passions ignited by this week's events have died down, the party will have to decide whether it really benefits their country to see that relationship destroyed.
How to listen to: From our own Correspondent
Radio 4: Saturdays, 1130. Second weekly edition on Thursdays, 1100 (some weeks only)
World Service: See programme schedules
Story by story at the