CHRISTCHURCH, New Zealand — The Australian man accused of killing 51 people and wounding dozens more as they worshiped at two mosques in New Zealand in March pleaded not guilty to scores of counts — including murder and a terrorism charge — in a brief court hearing on Friday.

Brenton Tarrant’s denial of guilt means survivors of the March 15 attacks, their families and the families of those who were killed must prepare for a lengthy and emotional trial, to start on May 4, 2020, that will pose many logistical and security challenges for officials. It will also force New Zealand’s court system to consider how to prevent Mr. Tarrant from using the trial as a platform for his self-proclaimed white supremacist views.

If found guilty at trial, Mr. Tarrant, 28, faces the prospect of life in prison without parole, a sentence that has never been handed down in New Zealand but which can be awarded at a judge’s discretion. The longest previous murder sentence in the country was 30 years without parole for a man who killed three people.

Fifty people were shot dead by a gunman wielding semiautomatic weapons in the attack on the Al Noor and Linwood mosques in the South Island city of Christchurch. Another man died of his injuries weeks later in a hospital.