Media playback is unsupported on your device Media caption Prince William: "The global ideology of hate will fail to divide us"

"You stood up and you stood together," the Duke of Cambridge has told New Zealanders in the aftermath of March's shootings which killed 50 people.

Prince William called the attacks an "unspeakable act of hate" in a speech at the Masjid Al Noor mosque in Christchurch, where 42 people died.

Praising the country's response, he said "in a moment of acute pain" they had "achieved something remarkable".

Earlier, the duke met survivors on a visit to a hospital in Christchurch.

He was joined at the mosque, during the second day of his visit, by Imam Gamal Fouda and New Zealand's Prime Minister, Jacinda Ardern.

Image copyright Getty Images Image caption Prince William visited a mosque where 42 people were killed

Image copyright Getty Images Image caption New Zealand's Prime Minister Jacinda Ardern joined Prince William on his visit to Masjid Al Noor mosque

Referring to the far-right gunman behind the shootings, Prince William said he had come to New Zealand to "help you show the world that he failed".

He said a "terrorist attempted to sow division and hatred in a place that stands for togetherness and selflessness".

He added: "But New Zealanders had other plans. The people of Al Noor and Linwood mosques had other plans. In a moment of acute pain, you stood up and you stood together."

Prince William also referred to the loss of his own mother, Princess Diana, and spoke of having to deal with grief.

He said: "Grief can change your outlook. You don't forget the shock and sadness or pain, but I do not believe grief changes who you are.

"If you let it, it will reveal who you are. It will reveal depths you did not know you had."

Image copyright Getty Images Image caption The prince visited staff at Christchurch Hospital where many of those injured in the attacks were taken

Image copyright Kensington Palace/Twitter Image caption Prince William met four-year-old Alen Alsati and her family

The prince had earlier met four-year-old Alen Alsati - who was injured in the attack and awoke from a coma earlier this week - on a visit to Starship Children's Hospital.

He also visited a memorial to the victims of the earthquake which hit Christchurch in 2011, where he laid a wreath.

En route, the prince stopped to talk to five-year-old Tilly Pearce, who stood among the crowds holding a sign which read: "Prince William I love your grandmother."

Image copyright PA Image caption Tilly's grandmother Kay Mintrom said the prince, promised "to say hello to the Queen from Tilly"

Tilly, who has been saving her pocket money for a trip to London to have tea with the Queen, described the moment as "really exciting".

Image copyright Getty Images Image caption Prince William also visited a memorial site for victims of the 2011 earthquake in Christchurch, with the city's mayor Lianne Dalziel

On the first day of his tour he received a traditional greeting called the hongi from Ms Ardern and attended an Anzac Day memorial service.