Image copyright TVNZ Image caption Brenton Tarrant in his first court appearance in March

The main suspect in the Christchurch attacks in March, has pleaded not guilty to all charges.

Brenton Tarrant is charged with the murder of 51 people, 40 counts of attempted murder and one terrorism charge in New Zealand's deadliest peace time mass shooting.

Appearing via video link from prison, the 28-year-old Australian sat silently as his lawyer read out his plea.

The 15 March attack saw a gunman open fire on Muslims during Friday prayers.

This is the first time a terrorism charge has been brought in New Zealand.

A number of the survivors of the attack and relatives of the victims were in court for the hearing, the BBC's Sydney correspondent Hywel Griffith reported.

As lawyer Shane Tait read out his client's not guilty pleas, a number of those present gasped and became tearful.

Media playback is unsupported on your device Media caption Maryam Gul says she has forgiven the man who killed her brother and parents

High Court Justice Cameron Mander said the trial had been set for 4 May next year, and that Mr Tarrant would be remanded in custody until a case review hearing on 16 August.

At his last court appearance in April, he was ordered to undergo mental health assessments to determine whether he was fit to stand trial.

Judge Mander said in a statement on Friday: "No issue arises regarding the defendant's fitness to plead, to instruct counsel, and to stand his trial. A fitness hearing is not required."

Last week, a restriction on publishing photos of the suspect's face was lifted.

'New Zealand's darkest day'

The suspect was arrested on 15 March for his alleged involvement in the shootings at the Al Noor mosque and the Linwood Islamic Centre, both located in Christchurch.

He allegedly drove first to the Al Noor mosque, parked nearby and began firing into the mosque as he walked in through the front entrance.

He allegedly fired on men, women and children inside for about five minutes. The attack was live-streamed from a head-mounted camera.

Victims of the Christchurch shootings

Fifty-one people lost their lives in the shootings at two mosques in the city. Here are some of their stories.

The suspect then allegedly drove about 5km (three miles) to the Linwood mosque and killed more people.

Addressing the nation in the wake of the attack, New Zealand Prime Minister Jacinda Ardern called it one of the country's "darkest days".

The gunman, armed with semi-automatic rifles including an AR-15, is believed to have modified his weapons with high-capacity magazines - the part of the gun which stores ammunition - so they could hold more bullets.

He is currently being kept in isolation at the Auckland Prison in Paremoremo, considered New Zealand's toughest prison.