Some 1.5 million protesters carried anti-government banners, red-and-white Turkish flags and pictures of Mustafa Kemal Ataturk, who founded the secular republic in 1923. Turkish flags hung from balconies and windows, as well as buses and fishing boats and yachts bobbing in Izmir's bay.
"I am here to defend my country," said Yuksel Uysal, a teacher. "I am here to defend Ataturk's revolution."
Throughout the morning, thousands were trying to reach Izmir and highways leading to the city were at a standstill. Municipal authorities said some 200,000 people sailed in on ferries.
The political turmoil displayed the growing secular-Islamic rift in this mainly Muslim country of 75 million that is vying for European Union membership and whose secular laws, enshrined in the constitution, are fiercely guarded by the judiciary and by the military.
Thousands of police were deployed, a day after a bomb at an Izmir market killed one person and injured 14 others. There was no claim of responsibility for the attack, nor evidence that it was linked to the demonstration. Izmir, on Turkey's Aegean coast, is a bastion of secularism, and Islamic parties fare poorly there.
The rally was organized as a show of strength ahead of general elections on July 22, and follows similar demonstrations in Ankara and Istanbul last month. A military official in Izmir, speaking on condition of anonymity because he was not authorized to speak to journalists, said the rally drew some 1.5 million people.
The rallies increased pressure on Prime Minister Recep Tayyip Erdogan's government, which nominated a presidential candidate deemed by the secular establishment to be Islamist.
The candidate, Foreign Minister Abdullah Gul, was forced to suspend his bid after the opposition boycotted the voting process in parliament. But the political turmoil exposed a deepening rift in Turkey, which has a secular legacy designed to separate state and religion.
Some protesters wore paper hats with the slogan: "No to Islamic law, no to military coups: a democratic Turkey" in a show that they did not approve of a military threat last month to intervene in the presidential elections in order to safeguard secularism. The military has ousted civilian governments in the past.
"These rallies have been useful in forcing the government to take a step back," said one of the protesters, Neslihan Erkan. "The danger is still not over. These rallies must continue until there is no longer a threat."
Gul, Erdogan's close ally, abandoned his presidential bid after pro-secular lawmakers boycotted two rounds of voting in parliament, creating a political deadlock.
Erdogan's government called early general elections and passed a constitutional amendment to let the people, instead of parliament, elect the president. The amendment must be endorsed by the current president, Ahmet Necdet Sezer.
Gul has indicated he could run for president in a popular vote.
Secularists fear that if Gul becomes president, the pro-Islamic ruling party could challenge the country's secular system unchecked. Sezer, a staunch secularist, had acted as a brake on the government by vetoing numerous bills and blocking the appointment of hundreds of officials.
Erdogan spent time in jail in 1999 for reciting an Islamic poem that prosecutors said amounted to a challenge to Turkey's secular system. Many of his party's members, including Gul, are pious Muslims who made their careers in the country's Islamist political movement.
Erdogan's supporters have spoken against restrictions on wearing Islamic-style head scarves in government offices and schools and supporting religious schools. His government also tried to criminalize adultery before being forced to back down under intense European Union pressure, and some party-run municipalities have taken steps to ban alcohol.
However, Erdogan's government rejects the claim that it has an Islamist agenda. It has done more than many other governments to implement Western-style reforms as part of its effort to join the European Union.
Some protesters in Izmir held banners that denounced the EU, which many Turkish nationalists believe is interfering in their country's affairs, as well as the United States, whose forces occupy neighboring Iraq.