Forty-nine people have been shot dead and 48 injured in attacks targeting Muslims at two mosques during Friday prayers in Christchurch, in the worst mass shooting in New Zealand’s history.

The prime minister, Jacinda Ardern, described the atrocity as a terrorist attack and said Friday had been “one of New Zealand’s darkest days”. Police commissioner Mike Bush said explosive devices in a car had been defused and urged all mosques across the country to close their doors for the time being.

A man in his late 20s was arrested and charged with murder. He will appear in court on Saturday morning. Two other armed suspects were being held in custody. Police said they were trying to determine how they might be involved.

Police have not named any of the suspects, but a man identifying himself as Brenton Tarrant, a 28-year-old born in Australia, broadcast livestream footage on Facebook showing him driving to a mosque, entering and shooting randomly at people inside.

New Zealand’s entire police arsenal and personnel were deployed throughout the country and en masse in Christchurch, the South Island’s largest city, which is known to have an active white-supremacist subculture.

Hotels in the inner city stationed security guards at their entrances, and armed police protected landmarks of significance, including the courthouse and Christchurch hospital, which is believed to have been a further target. A Christchurch spokesperson told local media police were concerned the suspects had plans to target the victims of the mosque attack as they were transported to hospital.

A “manifesto” was posted online before the attacks, in which the suspected gunman espoused far-right and anti-immigrant ideology.

The Australian prime minister, Scott Morrison, called the massacre a “rightwing extremist attack” and said one suspect was Australian-born, without giving further details. Ardern condemned the ideology of the people behind the shootings, saying: “You may have chosen us but we utterly reject and condemn you.”

New Zealand’s threat level has been raised from low to high. None of the suspects were on terrorism watchlists, Ardern said.

Facebook Twitter Pinterest Police officers secure the area in front of Al Noor mosque after the shooting. Photograph: Tessa Burrows/AFP/Getty Images

As dusk fell, people who escaped the two shootings returned to the scene, where they waited at the police cordon in an attempt to reach an unknown number of people still being held in a back room of Al Noor mosque, where 30 people were killed in the first attack. Ten people were later killed at the Linwood Islamic Centre, four miles (6km) away.

Relatives of those inside estimated about 100 people remained locked inside the mosque.

A trickle of Christchurch residents stood with the victims keeping vigil, rubbing their shoulders, offering food and logistical support. “We’re so sorry,” they repeated, and: “This is not us, this is not New Zealand.” Some in typical New Zealand fashion were using black humour, evidently as a coping mechanism in the midst of an overwhelming tragedy.

‘Where are we safe now?’

Hassan, 29, a Sri Lankan Muslim who has lived in New Zealand for six months, said he came to the country for its “peace, and because there are no wars”. He did not wish to give his last name.

He was at the Linwood mosque’s Friday prayer service when the shooting began, and hit the floor as women around him rose up and screamed at the gunmen “Do not come here,” some of them charging towards the gunman.

“The shooter was screaming a lot and waving the gun in every direction, shooting, shooting, shooting,” he said. “I don’t know who of my friends is dead or alive now. I am waiting. Police told me: ‘I am sorry, this is the first time this has ever happened in this country.’”

Hassan’s home is within the Al Noor police cordon, and he was unable to return on Friday night.

Mohammed, a Fijian Muslim who also did not wish to give his last name, was in Al Noor mosque when the shooting started. He escaped through the back door, but said his son-in-law was shot in the shoulder and his nephew was trapped inside.

Facebook Twitter Pinterest The national flag is flown at half-mast on a parliament building in Wellington. Photograph: Marty Melville/AFP/Getty Images

“I am happy that I am alive,” he said. “I am new to New Zealand and at the mosque you find your friends and family. They are after the Muslims. They only see religion … They don’t see people any more.

“We are not safe any more. Where are we safe now?”

As shots rang out, police put the city in lockdown and evacuated nearby climate change protests, with children separated from their relatives looked after by council staff until it was safe.

Those who live near the two mosques reported people climbing over fences to escape, and begging for help as the massacre unfolded.

The gunman entered Al Noor mosque in central Christchurch and opened fire at 1.40pm local time. An estimated 400 people were inside for Friday prayers. Len Peneha, a witness, told Associated Press he saw a man dressed in black go into the mosque and heard dozens of shots, followed by people running away in terror.

He said he saw the gunman flee before the emergency services arrived. Peneha said he went into the mosque to try to help: “I saw dead people everywhere.”

Another man who was at the mosque told TVNZ he had not seen his wife, who was also in the mosque, since the shooting. The man, who was in a wheelchair, pushed himself out to the car park.

Christchurch shooting: multiple fatalities after mass shooting at two mosques – live updates Read more

“It was very peaceful, calm and quiet, as it is when the sermon starts, you could hear a pin drop. Then suddenly the shooting started,” he said. “I saw about 20-plus people, some were dead, some were screaming. On the left there were 10-plus people, some were dead.”

The killer or killers then moved on to the Linwood mosque and killed a further 10 people.

Play Video 1:13 Eyewitnesses describe horror of Christchurch mosque shooting – video

In a statement just after 4pm local time, the police said Christchurch was in lockdown and urged people to stay indoors.

A Christchurch hospital spokesman said some victims were being treated at the emergency department but he could not provide numbers because the hospital was in lockdown.

The mayor of Christchurch, Lianne Dalziel, said the city was in shock: “This has come as a bolt from the blue ... It just feels like it’s not what would happen in a place like New Zealand.”

Earlier, Ardern said many of those directly affected by the shooting might be migrants to New Zealand.

Facebook Twitter Pinterest People call family and friends outside a mosque in central Christchurch in the aftermath of the shooting. Photograph: Mark Baker/AP

“They have chosen to make New Zealand their home, and it is their home. They are us,” she told reporters. “The person who has perpetuated this violence against us is not. They have no place in New Zealand.”

Members of the Bangladesh cricket team, who were outside Al Noor mosque when the shootings occurred, were unhurt. The team were due to play the final Test match of their New Zealand tour in Christchurch on Saturday. The game was cancelled. The New Zealand cricket team sent its “heartfelt condolences” in a post on Twitter.

All team members and staff caught up in the incident returned safely to their hotel, Bangladesh Cricket confirmed, after taking refuge in the immediate aftermath of the attack in the dressing rooms at Hagley Oval.

The Australian Department of Foreign Affairs and Trade has urged Australians in Christchurch to follow the instructions of local authorities, but has not changed its travel advice from normal safety precautions.

As the swell of family members grew outside the cordon at Al Noor mosque, local Christchurch residents began walking to the scene on foot, carrying flowers and laying them beneath a tree, and approaching survivors offering help.

Elsewhere, Christchurch seemed eerily deserted, the pubs and restaurants that would usually be bustling on a Friday closed as the city mourned.

• Crisis support services can be reached 24 hours a day. In New Zealand, the crisis support service Lifeline can be reached on 0800 543 354. In Australia, Lifeline is 13 11 14. In the UK and Irish Republic, contact Samaritans on 116 123. In the US, the National Suicide Prevention Lifeline is 1-800-273-8255. Other international helplines can be found at www.befrienders.org.