Addressing supporters at Istanbul airport from an open-top bus after returning from a trip to north Africa, Erdoğan called on his ruling party faithful to show restraint and distance themselves from "dirty games" and "lawless protests".
Despite earlier comments suggesting he could be softening his stance, Erdoğan was in combative mood. "These protests that are bordering on illegality must come to an end immediately," he said.
Erdoğan's reaction has been seen as decisive in determining whether the demonstrations fizzle out or rage on. Even as he spoke, thousands of protesters were rallying in Istanbul's Taksim Square, some of them chanting "Tayyip resign" while others sang and danced.
Back at the airport Erdoğan's supporters were equally defiant. "Those who raise their hands against the police should have their hands broken," they chanted.
Rights' groups say thousands of people have been injured in the demonstrations. Three people have died – two protesters and a police officer.
"We stood strong, but we were never stubborn. We are together, we are unified, we are brothers," Erdoğan told the crowds, who had blocked roads to the airport for hours, waiting for him until long after midnight.
"They say I am the prime minister of only 50%. It's not true. We have served the whole of the 76-million from the east to the west," Erdoğan said at the airport, referring to his election win in 2011 when he took 50% of the vote.
Speaking before he left Tunisia, Erdoğan had vowed to press ahead with the controversial redevelopment of an historic square in Istanbul that sparked the protests.
Erdoğan acknowledged that some of those who had objected to the development of Istanbul's Gezi Park had acted out of genuine environmental reasons. However, he also said "terror groups" were behind Turkey's biggest demonstrations in years and hinted at a plot involving radical Marxist-Leninists.
"Public property was damaged during the Gezi Park protests. The Taksim [Square] project is a project that will make Istanbul more beautiful," Erdoğan said.
He pledged to press ahead with the building of an Ottoman barracks on the site next to the park, despite the vehement objections of protesters. "You cannot rule a state with the logic of give and take," he said.
Protesters massing in Gezi Park – now the scene of a vast Glastonbury-style democracy festival – branded him out of touch with the public mood.
"He's very stubborn. I can't really understand him," Ayce Malkoc (26) said. "We will still go on protesting. We need green space."
Another protester, Lale, who declined to give her second name, said: "We don't want to fight. But we are not going to give up either."
Erdoğan did not say sorry but he did refer to an apology made by his deputy, Bülent Arinç, who on Tuesday admitted the police had behaved excessively, using too much tear gas. Striking a defiant tone, Erdoğan said his Islamist-rooted Justice and Development party (AKP) had won three elections and notched up 21-million votes. "We are against the majority tyrannising the minority. But we are definitely against the minority tyrannising the majority."
'Preparing for confrontation'
Political analysts said Turkey's leader continued to misinterpret the reasons behind the protests, which spread last week from Istanbul to other cities including the capital, Ankara.
"He believes there is a plot to overthrow him with the complicity of external and international forces," said Cengis Aktar, a professor of political science at Istanbul's Bahcesehir University. "Erdoğan has returned from abroad as angry dad. This is bad. It means he is preparing for confrontation."
Earlier this week Erdoğan denounced Twitter, which has helped thousands find out about the demonstrations.
On Thursday, Turkey's European Union minister Egemen Bagis heaped blame on the international media. Speaking at a press conference in Istanbul, he told the BBC's Middle East correspondent Jeremy Bowen that the corporation had encouraged the protesters to commit acts of vandalism.
Pro-Erdoğan channels, by contrast, failed to report on the protests for days, instead screening a documentary about penguins.
Turkey's interior ministry on Thursday insisted the authorities had behaved with restraint: "The police have done their duty selflessly and legally in hundreds of unreported demonstrations".
Despite Erdoğan's latest pronouncements, the future of Taksim Square is unclear. The prime minister announced he was dumping the unpopular idea of a shopping mall but would instead build a "stronger and better cultural centre" – a reference to the Ataturk cultural centre facing the square which has been derelict for years. Protesters have draped giant anti-Erdoğan banners across its modernist facade. "They [the protesters] want to block the good things the AKP has been doing," he said.
Erdoğan also linked the protests with an attack in February on the US embassy in Ankara, in which a suicide bomber killed himself and a Turkish security guard. The bomber was identified as a member of the Revolutionary People's Liberation Party-Front, an outlawed Marxist-Leninist party. Although several socialist and anarchist groups have erected tents in Gezi Park, there appears to be scant connection; most of the protesters have no party affiliation and little interest in formal politics.
The square is currently a giant pedestrian zone. Barricades erected by protesters remain in place after riot police pulled out of the area entirely on Saturday. As well as watermelons and kebabs, street vendors are now selling Guy Fawkes-style masks, as used by the group Anonymous and swimming goggles to protect against gas attacks. – © Guardian News and Media 2013