In more inflammatory comments, Erdogan said any Australians and New Zealanders traveling to Turkey with anti-Muslim sentiments would be sent back in coffins "like their grandfathers" were in the Gallipoli campaign.
The battle, marked by heavy casualties on both sides, was a disastrous defeat for the allies against the then Ottoman Empire. Although the battle later helped cement friendship between the three countries, more than a century later it remains a highly sensitive subject in both Australia and New Zealand.
Australia was aghast at Erdogan's comments, with Prime Minister Scott Morrison summoning Turkey's ambassador Wednesday and demanding Erdogan take the comments back, saying "all options are on the table" if he did not.
On Wednesday, a senior Turkish official said Erdogan's words "were unfortunately taken out of context."
"Turks have always been the most welcoming and gracious hosts to their Anzac visitors," he said.
It is not the first time Erdogan has sparked outrage abroad by making controversial statements about foreign countries, particularly during pre-election periods to stir up nationalist sentiment and consolidate his support base. He has sought to patch-up relations after the elections.
In 2017, in the run-up to a referendum on expanding the powers of Turkey's president, Erdogan had lashed out at the Netherlands and Germany, comparing them to Nazis after they barred Turkish officials from holding campaign rallies there.
Local elections are set to be held in Turkey on March 31. With the economy struggling, Erdogan's party risks losing the capital, Ankara, to the opposition. Such an outcome would be a severe blow to the president, whose ruling Justice and Development Party and its predecessor have run the city for the past quarter century.
On Wednesday Erdogan, inaugurating a theme park in Ankara as part of his pre-election campaign, called for votes for his ruling party candidates as a response to "occupiers who attempt to threaten our nation from tens of thousands of kilometers away."
Australia has issued a travel advisory warning people visiting the Gallipoli battlefields for remembrance ceremonies during next month's anniversary of the campaign to exercise caution.
Erdogan has also sparked outrage abroad by screening at his campaign rallies excerpts of a video taken by the gunman who killed 50 people in mosques in Christchurch, to denounce what he has called rising hatred and prejudice against Islam. Three Turkish citizens were among the dozens wounded in the attack.
Erdogan, whose party has roots in Turkey's Islamic movement, has also been showing parts of a manifesto said to have been left by the gunman in which he threatens Turks and Erdogan himself.
New Zealand has been trying to prevent the use of the videos. New Zealand's Foreign Minister Winston Peters is due in Istanbul this week for a meeting of the Organization for Islamic Cooperation to discuss the mosque shootings and was expected to take up the issue during the visit.
In Australia, Turkish ambassador Korhan Karakoc said he had a "frank" conversation with Morrison when the envoy was summoned to Parliament House on Wednesday.
"They are offensive because they insult the memory of our Anzacs and they violate the pledge that is etched in the stone at Gallipoli," he said, referring to a promise made by the founder of modern Turkey, Kemal Ataturk, that those who are buried rest on friendly soil.
"I do not accept the excuses that have been offered for those comments," Morrison said.
Turkish Foreign Minister Mevlut Cavusoglu later held a telephone conversation with his Australian counterpart, Marise Payne, Turkish Foreign Ministry officials said. They did not provide further details about the call.
In an opinion piece published in The Washington Post on Wednesday, Erdogan said the attacker in New Zealand is no different from the Islamic State group. He also called on Western leaders to learn from "the courage, leadership and sincerity" of New Zealand's Prime Minister Jacinda Ardern and "embrace Muslims living in their respective countries."
Elena Becatoros contributed from Athens, Greece.