The first Muslims to arrive in New Zealand, an British-Indian family, landed in Christchurch in 1854. Larger-scale Muslim immigration began in the 1970s, with the arrival of families and students from the Pacific islands. The region of Canterbury, which includes Christchurch, has been an area of steady growth.
Abdullah Drury, a scholar who completed a history of Muslim migration in New Zealand two years ago, said the Muslim population in Canterbury grew enough that by 1977, a formal association could be registered and organized. The group set up the first Muslim place of prayer on New Zealand’s South Island in Christchurch three years later.
Muslim immigration accelerated in the 1990s and 2000s with arrivals from war-torn countries like Iraq and Afghanistan. The 2013 census counted a national population of more than 4.2 million people, including more than 46,000 people who identified as Muslim, up nearly 30 percent from 2006.
Research shows that the majority of Muslims in New Zealand are Sunni, with a large Shia minority and some Ahmadi Muslims.
Now, Ms. Hanif said, a close community must become even closer: Both mosques that were attacked on Friday had already reached out to ask for help with funeral arrangements.
Ms. Ardern, the prime minister, noted that many of the victims were immigrants.
“For many this may not have been the place they were born,” she said. “For many, New Zealand was their choice, the place that they chose to come to and committed themselves to, the place they chose to raise their families.”
Ms. Ardern added that New Zealand had not been a target because it was a safe harbor for hatred, racism or extremism.
“We were chosen for the very fact that we are none of these things,” she said. “Because we represent diversity, kindness, compassion, a home for those who share our values, refuge for those who need it. Those values will not and cannot be shaken by this attack.”