As news of the terrorist atrocities in Christchurch spread, political leaders around the world expressed their sorrow, shock and anger at what the country’s prime minister, Jacinda Ardern, called “one of New Zealand’s darkest days”.

Donald Trump expressed his “warmest sympathy and best wishes” to the people of New Zealand after “the horrible massacre in the mosques”. The US president tweeted that “innocent people have so senselessly died” and added: “The US stands by New Zealand for anything we can do. God bless all!”

The White House press secretary, Sarah Sanders, described the attack as a “vicious act of hate” and said the US stood in solidarity with the people of New Zealand.

The British prime minister Theresa May called the assault, which killed at least 49 people and left dozens more injured, a “horrifying terrorist attack”.

“To target Muslims as they were attending their place of worship is despicable,” May said. “There can be no place in our societies for the vile ideology that drives and incites hatred and fear. Together we will defeat those who seek to destroy our values, our way of life and seek to divide us.”

Australia’s prime minister, Scott Morrison, ordered flags to be flown at half-mast in the aftermath of the attack. “I condemn the violent, extremist, rightwing terrorist attack that has stolen the lives of so many innocent New Zealanders as they went about their peaceful practice of worship at their mosques in Christchurch today,” he said.

One of Ardern’s predecessors, Helen Clark, said she was “in a state of shock” about what had happened in a country renowned for its peacefulness.

“This isn’t the NZ we know and love. It’s an unprecedented attack. Deepest sympathies to families. RIP,” she tweeted.

The United Nations secretary general António Guterres reiterated “the urgency of working better together globally to counter Islamophobia and eliminate intolerance and violent extremism in all its forms”, a spokesman said.

Two of the most high-profile leaders in the Muslim world offered their sympathies but pointed out that the attacks had occurred in a climate of increasing Islamophobia.

“I strongly condemn the terror attack against Al Noor mosque in New Zealand and Muslim worshippers,” said Turkey’s president, Recep Tayyip Erdoğan. “May Allah have mercy on the victims and grant a speedy recovery to the wounded.

He added: “On behalf of my country, I offer my condolences to the Islamic world and the people of New Zealand, who have been targeted by this deplorable act – the latest example of rising racism and Islamophobia.”

Imran Khan, who was elected prime minister of Pakistan last summer, said the attacks confirmed what he had always maintained: “that terrorism does not have a religion”.

However, Khan said Muslims worldwide had found themselves targeted and “demonised” since the 9/11 attacks on the US. “I blame these increasing terror attacks on the current Islamophobia post-9/11 where Islam and 1.3 bn Muslims have collectively been blamed for any act of terror by a Muslim,” he tweeted. “This has been done deliberately to also demonise legitimate Muslim political struggles.”

Iran’s foreign minister, Mohammad Javad Zarif, also tweeted that bigotry in western countries had led to the attacks and criticised the west for “defending [the] demonisation of Muslims as ‘freedom of expression’”.

The French president, Emmanuel Macron, offered his solidarity.

“All our thoughts are with the victims of the heinous crimes against the mosques of Christchurch, New Zealand, and with their loved ones,” he said. “France stands against all forms of extremism and acts with its partners against terrorism in the world.”

The Spanish government said it “forcefully condemns” the attacks.

“As well as wishing a swift recovery to the injured, the government offers its most sincere condolences to the friends and relatives of the victims, as well as to the people and government of New Zealand, a close ally in the shared fight against extremism and terrorism,” it said in a statement.

• 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.