More than 18,000 people have attended a candlelit vigil for victims of the Christchurch terrorist attack in the New Zealand city of Dunedin, where the gunman lived for two years.

Many of those in attendance at the Forsyth Barr Stadium, which is usually used for games of rugby and rock concerts, were students, who have been a constant presence outside the city’s sole mosque since last Friday, laying flowers and leaving notes of condolence.

﻿The students gathered before the vigil at the university campus before walking silently through the city’s streets to the stadium, joined by members of Dunedin’s Muslim community.

They were led by Abed Ghandour, of the Muslim University Students Association, who said he had “mixed emotions”.

“I am sad and I am happy,” Ghandour said. “Sad because of the lives that have been lost and happy because of the overwhelming support that we are getting.”

Among the thousands of students walking behind him were Ava Straw and Rosa Flaherty, who said they were attending in a show of solidarity and support. “It feels like the least we could do,” 18-year-old Flaherty said.

The crowd at Forsyth Barr Stadium on Thursday. Photograph: Dianne Manson/Getty

She said emotions had been running high in the city after it emerged that the gunman lived there before the attack. “It made us feel so scared to think that he was part of our community,” she said.

Straw, 20, said she was heartened to see so many students at the vigil, which she described as an important step in the healing process. “I think it shows that young people are able to move past just posting things on social media and are able to contribute a bit more to finding a bit of comfort amongst the grief,” she said.

The vigil opened with a a traditional Maori welcome followed by a Muslim prayer. As darkness fell, 50 candles were lit by community representatives, one for each life lost.

In an address to the crowd, the mayor of Dunedin, Dave Cull, said: “We cannot help but wonder why did this person come here. Why here? Among us? Our community is an inclusive, compassionate one … but we all need to redouble our efforts to embrace all our Muslim brothers and sisters.”

Dunedin, a city of 130,000 people, has a small but growing Muslim community, largely comprising former refugees from Syria and Afghanistan.

Mohammed Rizwan, the chair of the Otago Muslim Association, told those gathered that New Zealand was “not immune to racism, bigotry, Islamophobia and white supremacy”.

“We must do better,” he said. But he also saw hope: “With so much love each day, there is a little less darkness.”