Turkey's president has sparked a diplomatic fight with New Zealand after portraying the Anzac campaign during the First World War as Islamophobic while seeking to boost his chances in an upcoming election.

Recep Tayyip Erdogan was speaking after 50 people were killed as they prayed at two mosques in Christchurch, New Zealand.

The suspected gunman, Australian Brenton Tarrant, live-streamed the attack on social media and Mr Erdogan has played the clip - which media outlets in New Zealand, and in many other countries, have refused to show - during political rallies.

Image: There were 50 people killed in a terror attack on two mosques last week

In comments that further angered New Zealand and its neighbour Australia, he tried to link the massacre to the Anzac campaign in the First World War.

The 1915 campaign saw Australian and New Zealand troops (known as the Anzacs) sent to Turkey.


The Anzacs were eventually defeated but a close friendship developed between the three countries and Turks welcome thousands of Australians and New Zealanders to their country each year - especially on 25 April, when they gather to mark the Gallipoli landings and remember those killed.

Image: The Anzacs were defeated but a close friendship developed between them and Turkey

Image: Thousands of Australians and New Zealanders travel to Anzac Cover every year

The aim of the campaign had been to gain control over the Dardanelles and to open a supply route to British ally Russia.

But Mr Erdogan had a different version of history, saying at one rally: "What business did you have here? We had no issues with you, why did you come all the way over here?

"The only reason: we're Muslim and they're Christian."

He added: "They are testing us from 16,500km away, from New Zealand, with the messages they are giving from there.

"This [the Christchurch terror attack] isn't an individual act, this is organised."

Image: Commemorations for Anzac Day are due to take place on 25 April

Mr Erdogan also suggested that anyone coming to Turkey with anti-Muslim sentiments would be sent back in coffins, "like their grandfathers were" during the Gallipoli campaign.

It did not escape Australian and New Zealand leaders that his words were spoken in Canakkale province in northwestern Turkey, which is home to the battlefields of the Anzac campaign, just over a month ahead of Anzac Day.

Image: New Zealand Prime Minister Jacinda Ardern comforts a woman outside a mosque

New Zealand Prime Minister Jacinda Ardern sent her deputy and foreign minister, Winston Peters, to Turkey to "directly" confront the issue with officials there.

Australian Prime Minister Scott Morrison called in Turkey's ambassador to demand that the "highly offensive" remarks be withdrawn.

He also sent the Australian ambassador to Turkey to speak to Mr Erdogan's presidential aides, according to the Sydney Morning Herald, and the result of these talks will determine whether travel advice for Australians in Turkey would be changed.

Image: Mr Erdogan is 'trying to project himself as the guardian of Muslim people'

Politics professor Robert Patman, of New Zealand's Otago University, told Stuff.co.nz that Mr Erdogan was "trying to project himself as the guardian of Muslim people".

"What he's doing, though, is irresponsible, and he's playing into the hands of the terrorists, the people he claims he's against."