Thousands gathered in the early hours to greet him in the first pro-Erdogan rally since demonstrations began a week ago.
“No power but Allah can stop Turkey’s rise,” Mr Erdogan told the crowd.
At Istanbul’s Taksim Square, centre of the protests now occupied by thousands around the clock, some chanted “Tayyip resign” as they watched a broadcast of the address.
In the capital Ankara, Kugulu Park echoed to anti-government slogans, while protesters danced or sang the national anthem.
However, a senior European Union official criticised the Turkish police’s harsh crackdown on protesters, telling an audience that included the prime minister that a “swift and transparent” investigation was needed.
The comments by Stefan Fule, the EU enlargement commissioner, came at an Istanbul conference aimed at furthering the country’s decades-long ambition to join the 27-nation bloc.
That effort has advanced slowly, hampered by a dispute over EU-member Cyprus, Turkey’s previous human rights problems and some political resistance among EU members.
Mr Fule said people in democratic societies have the right to hold peaceful demonstrations and that police brutality was unacceptable.
In a week of demonstrations across the country, three people have been killed – two protesters and a policeman – and thousands injured. Turkey’s government has acknowledged that police used excessive force against some of the protesters.
Other Western governments including the United States, which sees Turkey as a key Nato ally in the Middle East, bordering Iran, Iraq and Syria, have expressed concern about heavy-handed police action.
Speaking from an open-topped bus at the airport yesterday, his wife at his side, Mr Erdogan acknowledged police might have used excessive force in crushing a small demonstration against a building project last Friday – the action that triggered nationwide protests against his 10-year-old rule.
“However, no-one has the right to attack us through this. May Allah preserve our fraternity and unity,” said Mr Erdogan, who denies accusations he seeks to replace a 90-year-old secular order with Islamic rule.
“The secret to our success is not tension and polarisation.
“The police are doing their duty. These protests, which have turned into vandalism and utter lawlessness must end immediately,” he told the crowd to loud cheers.
He gave no indication of any immediate plans to remove the makeshift protest camps that have appeared on Taksim Square and a park in the capital, Ankara.
Mr Erdogan, who has pressed many democratic reforms and tamed a military that had toppled four governments in four decades, faces criticism that his rule has become authoritarian.