The US military’s Pacific Command said there was no threat to Hawaii after an official message was sent to residents mobile phones, warning them of an imminent ballistic missile attack.

Against a backdrop of increased tension with North Korea which has said its missiles can reach the US, a message was sent in block capitals: “Ballistic missile threat inbound to Hawaii. Seek immediate shelter. This is not a drill.”

The text was sent out by the national Emergency Alert System, designed to allow the US government to warn Americans within 10 minutes of authorities learning of a threat.

State governor David Ige said it was sent when an employee pushed the wrong button during a shift change, CNN reported, and the Hawaii Emergency Management Agency (HEMA) later said on Twitter: “NO missile threat to Hawaii.”

US President Donald Trump was briefed about the incident, as a number of people complained that the authorities had been slow to tell the public there was no threat.

“The President has been briefed on the state of Hawaii's emergency management exercise. This was purely a state exercise,” White House spokeswoman Lindsay Walters said.

HEMA said it was investigating what had happened.

“What happened today is totally inexcusable,” added senator Brian Schatz. “The whole state was terrified. There needs to be tough and quick accountability and a fixed process.”

He added: “There is nothing more important to Hawaii than professionalizing and fool-proofing this process.”

Many complained they were not told the alert was a false alarm for more than half an hour after the initial warning was issued.

Carla Herreria, a journalist in north Hawaii community of Haleiwa, said she “texted everyone in my family that I loved them en-route to a place to hid with other family members”.

“I saw civilian cars pulling over to alert other pedestrians to take cover,” she wrote on Twitter. “The alert may have been a mistake, but it caused chaos and mass fear for island residents. And it lasted for more than 30 minutes before the state corrected the mistake.”

Jamie Malapit, owner of a Honolulu hair salon, texted his clients that he was cancelling their appointments and was closing his shop for the day after receiving the erroneous alert.

He said he was still in bed when the phone started going off “like crazy”. He thought it was a tsunami warning at first.

“I woke up and saw missile warning and thought ‘no way’. I thought ‘No, this is not happening today’,” Mr Malapit said.

He was still “a little freaked out” and feeling paranoid even after hearing it was a false alarm.

“I went from panic to semi-panic and ‘Are we sure?”’ he added.

Hawaii last year brought back sirens which had not been tested since the Cold War in response to an escalating war of words between Mr Trump and Kim Jong-un.

Experts believe a North Korean missile could take just 20 minutes to reach Hawaii, leaving people with little time to react.