LJUBLJANA, Slovenia — Names of medieval Serbian, Hungarian and Bulgarian knights were scrawled on the magazines of a rifle belonging to the suspected attacker behind New Zealand's worst-ever mass shooting.

A Serbian folk song glorifying Radovan Karadzic — the Bosnian Serb leader convicted of war crimes against Muslims during the war that tore apart Yugoslavia in the mid-1990s — played in Brenton Tarrant's car minutes before he allegedly launched the attack that killed 50 at two mosques in Christchurch.

The Australian had also traveled in southeastern Europe twice in the past two years.

Grab from a video showing messages on the weapons allegedly used by the New Zealand gunman.

Tarrant's fascination with the region shines a spotlight on half-forgotten myths about Crusader knights and Serbian nationalists who fought Muslim armies. These stories have become popular among white supremacists online — a narrative that also periodically bleeds into politics offline.

“We see this whole association of Islamophobia with this kind of fake past of Teutonic knights slaying the evil Muslim hordes,” said Ibrahim Hooper, spokesperson for the Council on American-Islamic Relations — a prominent Muslim-American civil rights organization.

This strain of right-wing extremism is virulently anti-Islam and seeks to stoke fears that Muslims will overwhelm the West — a sort of mirror image of Islamic State militants who espouse their brutal version of an ancient world governed by precepts of early Islam.

The white nationalist ideology shared on fringe message boards such as 4chan and 8chan has reignited a debate about whether technology companies are doing enough to crack down on the dissemination of white supremacist hate online.

Tarrant's apparent 74-page manifesto posted online shortly before the attack also said Muslims were targeted because they are the “most despised group of invaders in the West.”

This idea of fighting Muslims is the theme of the Serbian folk song that was being played in Tarrant's car before the attack. Known online as “Remove Kebab,” it and associated memes are a euphemism for violent campaigns to drive out Muslims from a region.

Anders Behring Breivik, who is in prison after killing dozens in Norway, first made this imagery of medieval knights pushing Muslims out of Europe popular among far-right extremists, according to Heidi Beirich, director of the intelligence project at the Southern Poverty Law Center, which tracks hate groups and extremists.

In July 2011, Breivik went on a rampage across Norway including at a summer camp for the left-wing Labor Party's youth wing. In total 77 people were killed, most of them teenagers.

Like Tarrant, Breivik also had a particular interest in Balkan affairs and history. Speaking in court in Oslo in 2012, Breivik said he had been inspired by Serbian nationalists.

For the extreme right to prevail again in Europe, extremists would have to distance themselves from old-school Nazi ideology, he said. The new identity, he added, was partly imported from Serbia.

Supporters of Serbian ultra-nationalist leader Vojislav Seselj rally in Belgrade in 2016. Marko Djurica / Reuters file

Tarrant's alleged manifesto claims that Breivik was his "true inspiration" and he describes the Norwegian as a "knight."

On his visit to the region last year, Tarrant exhibited an interest in battles between Christians and Ottomans, and visited historic sites, according to Bulgarian Prosecutor General Sotir Tsatsarov.

Tarrant's apparent penchant was for medieval and early modern battles in which Balkan armies repelled and defeated the Ottoman Empire, a state created by Muslim Turkish tribes in the 15th and 16th centuries that at its height encompassed most of southeast Europe.

For centuries, Balkan kings, rulers and later leaders of nation states have presented themselves as “the defenders of Europe against the onslaught of Islam," according to Florian Bieber, professor of southeast European studies at the University of Graz in Austria.

Among the knights and generals scrawled on the magazines of Tarrant's weapons was the medieval Serbian knight Miloš Obilić, who allegedly killed the Ottoman sultan at the Battle of Kosovo in 1389. The Serbian government grants the medal for bravery named after Miloš Obilić to courageous soldiers, while sports clubs throughout the country also bear the knight's name.

While Tarrant was in Bulgaria, he visited the region of Shipka Pass where the Russians and Bulgarians defeated the Ottomans in a legendary battle in 1877.

In the 19th century, Balkan nations began to expel local Muslims who had been converted to Islam by the Ottomans as they saw them as a threat, Bieber said.

More recently, during the mass violence of the 1990s Balkans war, Serbian nationalists framed their attacks on Bosnian and Albanian Muslims as an epic battle between two religions.

This “complete mischaracterization” of events “resonated with far-right groups across the world, including those who radicalized to commit acts of terrorism,” Bieber said.

Sharing 'hate rhetoric'

Those that monitor hate speech on the internet had expressed their concern that right-wing extremism was spreading globally online.

From the United States to New Zealand via Europe, white supremacist Islamophobes are "increasingly cooperating and coordinating and sharing each other's hate rhetoric," Hooper of the Council on American-Islamic Relations said.

Beirich, of the Southern Poverty Law Center, said white supremacist propaganda and hate speech were not treated with the same concern by authorities as that of Islamist extremists such as the Islamic State group and Al Qaeda.

Technology companies and lawmakers in the West equate Islamist extremism online with terrorism but have "completely forgotten" white supremacy and its death toll, she said.

Offline, the anti-Islam narrative of the extreme right is also increasingly resonating with right-wing politicians in the region.

Hungary's autocratic leader Viktor Orban has evoked anti-Islamic imagery to justify policies such as closing borders to asylum-seekers many of whom are fleeing conflict and persecution — recalling the myths that have enervated right-wing extremists.

The majority of migrants arriving in Europe are from "the Islamic world," Orban said in his state of the nation address last year.

"If things continue like this, our culture, our identity and our nations as we know them will cease to exist. Our worst nightmares will have become reality," he said in that speech in February 2018.

But in reality, the numbers of migrants arriving in the Balkan region are few compared to those seeking asylum in northern Europe.

In 2017, Hungary granted asylum to 106 refugees, according to the European Council on Refugees and Exiles — a tiny fraction of claims being granted elsewhere in the European Union.

After Hungary built a wall along its borders with Croatia and Serbia at the end of 2015, the number of arrivals dropped from more than 7,000 people a day to 10, according to the International Organization for Migration.

Hungarian Prime Minister Viktor Orban delivers his annual state of the nation speech in Budapest in February. Bernadett Szabo / Reuters file

Despite the low numbers, many lawmakers in the region have won office on anti-immigrant platforms.

Last year, the Czech President Milos Zeman was re-elected on a wave of anti-immigrant and anti-Muslim feeling despite the fact that in November 2017 — two months before the vote — only 116 people lodged asylum claims in the country.

Meanwhile, human rights groups have criticized the mistreatment of migrants in several Balkan countries. Last year, groups accused Hungarian authorities of refusing food to some asylum-seekers held in two border camps while they awaited the outcome of their asylum process.

The 2015 influx of asylum-seekers saw vigilante groups emerge in Balkan states and start patrolling borders to keep migrants out.

The "BNO Shipka" group in Bulgaria hunts down migrants attempting to cross the forested mountain range on its border with Turkey.

“It’s not a problem that they are Muslims. The problem is, it’s a different civilization,” Nikolai Ivanov, a founding member of the group, told NBC News in 2017.

As New Zealand moves ahead with its investigation into the last week's massacres, several European countries have said they have launched a probe into the suspect's potential ties to the region.

Balkan nations have condemned the attack and officials have distanced their countries from the suspect. Locals have also said they are frustrated their region is being associated with the attacker.

“This man has nothing to do with Serbia,” Serbian Foreign Minister Ivica Dacic said. “I don’t know where he took his inspiration, but it looks to me that on that list there was names of other countries too.”

Vladimir Banic reported from Ljubjana and Saphora Smith reported from London.