Few images of Turkey's expanding influence are more powerful than of Mr. Erdogan joining hands with Libya's new leaders for Friday prayers today.
"After we thank God, we thank our friend Mr. Erdogan, and after him all the Turkish people," prayer leader Salem al-Sheikhi told the crowd of several thousand in Tripoli's Martyrs' Square. Erdogan knelt in the front row beside Mustafa Ahmed Jalil, chairman of Libya's National Transitional Council.
"Our hands are clasped with those of the Turkish people," said Mr. Sheikhi. "We will never forget what you did for us."
Erdogan replied in kind afterward, turning the prayer session into a rally where Turkish flags commingled with new revolutionary ones. "Turkey will fight with you until you take all your victory," he said. "You proved to all the world that nothing can stand in the way of what the people want."
Indeed, the Turkish prime minister's "Arab Spring tour" has been a hit as he makes his way across North Africa extolling Turkey as a democratic model for fellow Muslims who have cast off their dictators.
As the elected leader of a thriving Muslim democracy, Erdogan portrays himself as uniquely placed to encourage an orderly transition from autocracy to democracy – one that will rein in the more extremist Muslim groups unleashed by the Arab Spring.
But while Erdogan's message of secular democracy may resonate with the West, the foundations of his growing prestige are worrying to US leaders. As his Islam-rooted party has increased its influence, Erdogan has taken a tougher stance against Israel, which he accuses of oppressing the Palestinian people and flouting international law.
Some say he risks a breach with the West by antagonizing Israel, but others contend he is offering a type of Muslim leadership that Europe and the US would do well to heed.
"In the Islamic world we need a stable and reliable voice that's talking about both secularism and Islam, and at the moment, the only one who can provide it is Erdogan's Turkey," says Gokhan Bacik, head of the Middle East Research Center at Turkey's Zirve University.
"He's giving a message not only to the Middle East, but also telling the West that although they are worrying about Turkey turning to Islam, it is preaching secularism in its neighborhood," he says.
Turkey pitches its democratic model
As former Islamists governing within a traditionally secular system, Erdogan's Justice and Development Party (AKP) presents itself as having forged a durable marriage between Islam and democracy.
In June, the AKP won reelection by a landslide, giving Erdogan a third term. He and his party have used their rising influence at home to spur rapid economic growth and weaken the hold of the military, which had ousted four governments in 40 years before the AKP came to power in 2002.
Last year Turkey's economy expanded by 8.9 percent - the second-fastest growth rate in the Group of 20. And the country's four top generals resigned in July, signaling the final knell for the military's longtime control over civilian governments.
"I think Turkey has proven to be sustainable and responsive to the expectations of a society who are looking for greater democracy and well-being," says Cengiz Aktar, an international relations professor at Istanbul's Bahcesehir University.
He also says it offers a competing model to systems of sharia (Islamic law) espoused by some Islamist factions now vying for influence in the Arab world.
"Do not be wary of secularism," Erdogan urged Egyptians on a popular evening chat show in Cairo on Tuesday. "A secular state does not mean that the people are atheists. It means respect for all religions and each individual has the freedom to practice his own religion."
Toughened stance on Israel
Erdogan's message of secular democracy may be welcome in the US, but other parts of his spiel make many in Washington squirm.
"Let's raise the Palestinian flag and let that flag be the symbol of peace and justice in the Middle East," he said at an Arab League meeting in Cairo, laying claim to what many see as a touchstone issue for any Muslim leader seeking regional influence.
His words came after Turkey cut ties with former ally Israel, kicking out the Israeli ambassador, ending military cooperation, and vowing to step up naval patrols in the eastern Mediterranean – or even go to war.
The ostensible reason for Turkey's rejection of its longtime ally was Israel's refusal to apologize for last year's raid on a Gaza-bound aid boat during which nine Turks were killed.
But Asli Aydintasbas, a foreign-affairs columnist for Turkey's daily Milliyet newspaper, says she believes that although the row is driven partly by ideology and opportunism, a significant factor is Turkey's desire to expand its regional influence.
"Turkey wants to make itself the Middle East's big brother, and what better way to do that than pick a fight with the guy everyone's afraid of?" asks Ms. Aydintasbas.
Why the West can't write off Turkey
With its surging economy and burgeoning ties with countries outside the Western axis, Turkey may be confronting Israel now simply because it can, she adds.
"All of a sudden there's self-confidence in the government – that's very noticeable," she says. "Five years ago they would have feared the economic impact and the reaction of the US Jewish lobby."
But Erdogan's critique of Israel is still more measured – and thus harder to write off – than the harangues of a leader like Iranian President Mahmoud Ahmadinejad. In one recent example, he said that Israel "must respect human rights and act as a normal country and then it will be liberated from its isolation."
"[Turkey] keeps on making distinctions between the current Israeli government, and the state and people of Israel," says Soli Ozel, a political scientist at Istanbul's Kadir Has University.
While the deterioration of Turkish-Israeli ties may make Washington uneasy, Turkey's strategic importance to the West may mean that the US can do little about it.
Turkey, with the second-largest military in NATO, has just agreed to host a radar station crucial to NATO's planned missile defense system.
"If Turkey is serving a purpose for Western security and strategic calculations, I think it can [antagonize Israel]," says Mr. Ozel. "What can they do? Drop Turkey and align with Iran?"
Staff writer Scott Peterson contributed reporting from Tripoli, Libya.