CHRISTCHURCH, New Zealand — New Zealanders like to think of themselves as an open, tolerant lot. And by many measures, they absolutely are. We absolutely are.

As I’ve returned to my home country to cover a tragedy none of us could ever imagine happening here, I’ve been struck by just how much it’s changed in the almost 20 years I’ve been away.

Now, 1 in 4 New Zealand citizens was born outside the country. There are more than 200 ethnicities represented in a population of 4.8 million people — more ethnicities than the number of countries represented at the United Nations.

As President Trump was capping refugee numbers, Prime Minister Jacinda Ardern was increasing New Zealand’s refugee quota. In a world of growing anti-immigrant populism, many in New Zealand feel like they’re heading in the right direction.

But last Friday’s attacks on two mosques in Christchurch, which left 50 people dead, have caused soul-searching as well as shock among my compatriots.

Maybe we’ve been so caught up in our progress that we haven’t seen what hasn’t changed.

“I think this is a really good opportunity for people to stop and say, ‘What do we need to do to become the country that we talk about ourselves as being?’ ” said Susan Devoy, who was the country’s race relations commissioner until last year.

It would be easy for New Zealanders to distance themselves from the attacks, given that the alleged gunman was an Australian who said in his manifesto that he had deliberately come here, apparently to increase the shock value of his actions. Australia has had a few such attacks, although nowhere near as huge, but New Zealand had had none.

Indeed, the refrain that has been repeated constantly since the attacks, by everyone from the prime minister down, is: “This is not us.” 

Some New Zealanders are now standing up to say, er, it kind of is us.

We are deluding ourselves, they say, to try to distance ourselves from the suspected shooter just because he’s Australian. He lived here, he trained at a rifle club here, he was supported here.

“We can’t pretend this was an aberration from overseas. The truth is it happened here, and it began with hate speech allowed to grow online,” Golriz Ghahraman, a Green MP who came to New Zealand from Iran as a refugee when she was 9 years old, said in parliament Wednesday.

New Zealand has had a race relations problem ever since it was colonized by Britain as a settler colony in the early 1800s. The Maori population continues to suffer even today. Maori make up 15 percent of the New Zealand population but account for more than half the prison population. They are at the bottom of many health and economic statistical tables.

Auckland is the biggest Polynesian city in the world. Historical issues and socioeconomic disparities between the indigenous Maori and the Pakeha — or New Zealanders of European descent — are slowly being addressed, although a lot remains to be done.

“White supremacy is a black strand woven through our history as a nation,” acclaimed historian Anne Salmond wrote in the Christchurch newspaper the Press this week.

I attended journalism school here in 1997, and this city in particular has changed in extraordinary ways.

The Maori population in the South Island has increased, and the Maori language is now spoken much more widely and naturally in everyday life across the country. Students spontaneously performed the Maori haka, a dance showing unity and strength, at memorials to the dead this week.

There are large and visible Chinese and Korean populations, thanks partly to the universities here, and many of them are thriving. Christchurch has also become home to increasing populations of refugees and immigrants from other parts of the world, especially the Middle East and South Asia.

Societal attitudes, however, haven’t quite kept up with this rapid change.

For an illustration of the dichotomies that continue, look no further than the coalition government. While Ardern has won praise for her compassionate response to the attacks, which included wearing a headscarf to see Muslim victims, her deputy prime minister, Winston Peters, and his party, New Zealand First, have concerns about immigration at their core.

Peters has repeatedly suggested there is a link between Muslim immigration and terrorist attacks, and as recently as 2014 was making racist jokes about Chinese immigrants pushing up house prices.

Acclaimed filmmaker Taika Waititi caused a heated debate here when he said in an interview last year that New Zealand was “racist as f---.”

If an activist had said the same thing, it would have been easy to dismiss. But Waititi was able to garner attention because of who he is: Maori, famous for top-shelf entertainment, New Zealander of the Year in 2017. It caused a ruckus.

“New Zealanders like to think that everyone gets a fair go and that we’re not a racist society,” said David Small, an academic at the University of Canterbury. “Even the racists don’t like to be called racist.”

That may be true of the casual racism that the filmmaker Waititi was targeting. But New Zealand does have its white nationalist movements, and they have traditionally been concentrated in Christchurch, a city that has long been notably whiter than the other parts of the country, particularly the North Island. 

Acclaimed director Taika Waititi recorded a video for the Human Rights Commission to highlight the effects of casual racism in New Zealand. He sardonically tells people to do their bit and give to racism. - NZ Human Rights Commission

Christchurch has long had an ugly underbelly of skinheads with swastika tattoos. They belong to groups with names like Right Wing Resistance and National Front and occasionally hold rallies. 

Just last month some skinheads reportedly tried to rip the hijabs of women in Dunedin, about 225 miles south of Christchurch, while on Saturday, the day after the shootings, there were reports of skinheads causing disturbances in the Christchurch suburb of New Brighton.

New Zealand’s geographic isolation had helped keep the tiny group of white nationalists here isolated, too. But the emergence of extremist communities online has helped them feel connected to a larger movement and has endorsed their beliefs, experts like Small say.

That has helped the groups such as white nationalists gather momentum.

Muslim community leaders have noticed this and had appealed to the government to protect them.

“No one seemed to take the threats that Muslims were reporting to the government seriously,” Devoy said.

Meanwhile, the authorities had been treating Muslim communities as a potential threat, heavily surveilling the Al Noor Mosque — one of the sites of Friday’s massacre — while ignoring pleas for protection, according to some members of the Muslim community. 

In 2016, a group of men doing Hitler salutes delivered boxes of pigs’ heads and offal to the mosque and recorded themselves doing it. “White power. . . . Bring on the cull,” the leader of the group, Philip Arps, was seen saying in a video of the attack. He was convicted of offensive behavior and fined $800.

Arps was back in court Wednesday, charged with sharing the video taken by the alleged gunman.

Most countries have fringe groups that are not representative of the mainstream.

But in New Zealand, the challenge of addressing these issues is made more difficult because there is no hate crime legislation.

“Xenophobia, homophobia, transphobia, it’s all recorded as assault or property damage,” said Devoy, the former race relations commissioner. “So it’s really hard to understand the extent to which we have a problem.”

Now, pointed questions are being raised about whether the security agencies ignored warning signs, or put too much focus on the threat of Islamic extremism at the expense of protecting Muslims. Ardern, the prime minister, has ordered an inquiry.

In the wake of the Friday massacre, though, even the most critical voices think change is possible.

“I’m actually really hopeful that this will act as a watershed moment for us because of the incredible numbers of people who have shown up every day with flowers and at vigils,” Ghahraman said in an interview. “The grief is really palpable among all the communities across New Zealand.”