When, two days after the mass shooting in New Zealand, Turkish Vice President Fuat Oktay and Foreign Minister Mevlüt Çavuşoğlu became the first high-level foreign government delegation to travel to Christchurch, they were doing more than just expressing solidarity with New Zealand’s grieving Muslim community. They were planting Turkey’s flag as part of a global effort to expand support for President Recep Tayyip Erdoğan’s style of religiously packaged authoritarian rule—a marriage of Islam and Turkish nationalism—beyond the Turkic and former Ottoman world.

While showing footage of the March 15 shooting rampage in Christchurch, New Zealand, at a rally in advance of the March 31 local elections, Erdoğan declared “there is a benefit in watching this on the screen. Remnants of the Crusaders cannot prevent Turkey’s rise.”

He went on to say, “We have been here for 1,000 years, and God willing, we will be until doomsday. You will not be able to make Istanbul Constantinople. Your ancestors came and saw that we were here. Some of them returned on foot and some returned in coffins. If you come with the same intent, we will be waiting for you, too.”

Erdoğan was responding to an assertion by Brenton Tarrant, the white-supremacist perpetrator of the Christchurch attacks in which 49 people were killed in two mosques, that Turks were “ethnic soldiers currently occupying Europe.”

Oktay’s and Çavuşoğlu’s visit is one more facet of a Turkish campaign that employs religious as well as traditional diplomatic tools.

The campaign aims to establish Turkey as a leader of the Muslim world in competition with Saudi Arabia, the United Arab Emirates, and, to a lesser degree, Morocco.

As part of the campaign, Turkey has positioned itself as a cheerleader for Muslim causes such as Jerusalem and the Rohingya at a moment when Saudi Arabia, the UAE and other Muslim nations are taking a step back.

Although it’s being careful not to rupture relations with Beijing, Ankara has also breached the wall of silence maintained by the vast majority of Muslim countries by speaking out against China’s brutal crackdown on Turkic Muslims in the troubled northwestern province of Xinjiang.

Erdoğan’s religious and traditional diplomatic effort has seen Turkey build grand mosques and cultural centers across the globe in the United States, the Caribbean, Europe, Africa and Asia; finance religious education; and restore Ottoman heritage sites.

It has pressured governments in Africa and Asia to hand over schools operated by the Hizmet movement led by exiled preacher Fethullah Gülen. Erdoğan holds Gülen responsible for the failed military coup in Turkey in 2016.

On the diplomatic front, Turkey has in recent years opened at least 26 embassies in Africa, expanded the Turkish Airlines network to 55 destinations in Africa, established military bases in Somalia and Qatar, and negotiated a long-term lease for Sudan’s Suakin Island in the Red Sea.

The Turkish religious campaign takes a leaf out of Saudi Arabia’s four-decade, $100 billion effort to globally propagate ultra-conservative Sunni Islam.

Like the Saudis, Turkey’s Directorate of Religious Affairs (Diyanet) provides services to Muslim communities, organizes pilgrimages to Mecca, trains religious personnel, publishes religious literature, translates the Koran into local languages and funds students from across the world to study Islam at Turkish institutions.

Turkish Muslim NGOs provide humanitarian assistance in former parts of the Ottoman Empire, the Middle East and Africa in a manner quite similar to that of the Saudi-led World Muslim League and other Saudi NGOs, many of which have been shut down since the 9/11 attacks on New York and Washington.

Ever since the rise of Crown Prince Mohammed bin Salman in 2015, Saudi Arabia has significantly reduced global funding for ultra-conservatism.

Nonetheless, Turkey is at loggerheads with Saudi Arabia, as well as the UAE over the killing of Washington Post journalist Jamal Khashoggi; Turkish support for Qatar in its dispute with the Saudis and Emiratis; differences over Libya, Syria and the Kurds; and Ankara’s activist foreign policy. Turkey is seeking to position itself as an Islamic alternative.

Decades of Saudi funding have left the kingdom’s imprint on the global Muslim community. Yet Turkey’s current struggles with Saudi Arabia are more geopolitical than ideological.

As for the UAE, while Turkey competes geopolitically with the Emirates in the Horn of Africa, Libya and Syria, ideologically the two countries’ rivalry centers around the UAE’s effort to establish itself as a center of a quietist, apolitical Islam versus Turkey’s activist approach and support for the Muslim Brotherhood.

In contrast to Saudi Arabia, which adheres to Wahhabism, an austere ultra-conservative interpretation of the faith, the UAE projects itself and its religiosity as far more modern, tolerant and forward-looking.

The UAE’s projection goes beyond Prince Muhammad’s attempt to shave off the raw edges of Wahhabism in an effort to present himself as a proponent of what he has termed moderate Islam.

The UAE scored a significant success recently with its first-ever papal visit. In February, Pope Francis I came to the country. While there, he signed a Document on Human Fraternity with Sheikh Ahmad Tayeb, the grand imam of Egypt’s Al-Azhar—the revered 1,000-year-old seat of Sunni Muslim learning.

The signing was the result of UAE-funded efforts by Egyptian general-turned-president Abdel Fattah El-Sisi to depoliticize Islam and gain control of Al Azhar—efforts Sheikh Tayeb has resisted despite having supported Sisi’s 2013 military coup.

To enhance its influence within Al Azhar and counter that of Saudi Araba, the UAE has funded Egyptian universities and hospitals and has encouraged Al Azhar to open a branch in the UAE.

The UAE effort paid off when the pope, in a public address, offered thanks to Egyptian judge Muhammad Abdel Salam, an adviser to Sheikh Tayeb who is believed to be close to both the Emiratis and to Sisi, for drafting the declaration.

The Turkey-UAE rivalry has spilled from the geopolitical and ideological into competing versions of Islamic history.

Last year, Turkey renamed the street on which the UAE embassy in Ankara is located after an Ottoman general. This move was the result of a Twitter spat between Erdoğan and UAE Foreign Minister Abdullah bin Zayed al-Nahyan.

The tweet that roused Erdoğan’s ire accused Fahreddin Pasha, who defended the holy city of Medina against the British in the early 20th century, of abusing the local Arab population and stealing their property, as well as sacred relics from the Prophet Muhammad’s tomb. The tweet described the general as one of Erdoğan’s ancestors.

“When my ancestors were defending Medina, you impudent [man], where were yours?” Erdogan retorted, referring to Nahyan. “Some impertinent man sinks low and goes as far as accusing our ancestors of thievery. What spoiled this man? He was spoiled by oil, by the money he has.”

Dr. James M. Dorsey, a non-resident senior associate at the BESA Center, is a senior fellow at the S. Rajaratnam School of International Studies at Singapore’s Nanyang Technological University and co-director of the University of Würzburg’s Institute for Fan Culture.