HONOLULU — A false alarm that warned of a ballistic missile headed for Hawaii sent the islands into a panic for 38 harrowing minutes Saturday, with people abandoning cars on a highway and preparing to flee their homes until officials said the cellphone alert was a mistake.

In a conciliatory news conference later in the day, Hawaii officials apologized for the mistake and vowed to ensure it will never happen again.

“We made a mistake,” Hawaii Emergency Management Agency Administrator Vern Miyagi said.

Hawaii Gov. David Ige apologized for the “pain and confusion” caused by the alert and said the false warning was “a mistake made during a standard procedure at the changeover of a shift and an employee pushed the wrong button.”

At the news conference, Ige and Miyagi promised no single person will be able to cause such an error in the future. Miyagi said a rule has already been put in place to mandate that two people be present before the button is pushed to alert for a drill or emergency. He also said a cancellation message template will be created for such an error scenario so a delay like Saturday’s does not happen again.

For nearly 40 minutes, it seemed like the world was about to end in Hawaii, an island paradise already jittery over the threat of nuclear-tipped missiles from North Korea.

The emergency alert, which was sent to cellphones statewide just before 8:10 a.m. local time, said: “BALLISTIC MISSILE THREAT INBOUND TO HAWAII. SEEK IMMEDIATE SHELTER. THIS IS NOT A DRILL.”

On the H-3, a major highway north of Honolulu, vehicles sat empty after drivers left them to run to a tunnel after the alert, the Honolulu Star-Advertiser reported. Workers at a golf club huddled in a kitchen.

Professional golfer Colt Knost, staying at Waikiki Beach during a PGA Tour event, said “everyone was panicking” in the lobby of his hotel. “Everyone was running around like, ‘What do we do?’?” he said.

Cherese Carlson, in Honolulu for a class and away from her children, said she called to make sure they were inside after getting the alert. “I thought, ‘Oh my God, this is it. Something bad’s about to happen and I could die,’ ” she said.

The Hawaii Emergency Management Agency tweeted there was no threat about 10 minutes after the initial alert, but that didn’t reach people who aren’t on the social media platform.

A revised alert informing of the “false alarm” didn’t reach cellphones until 38 minutes after the false alert, according to the time stamp on images people shared on social media.

The incident prompted defense agencies including the Pentagon and the U.S. Pacific Command to issue the same statement, that they had “detected no ballistic missile threat to Hawaii.”

The White House said President Donald Trump, at his private club in Florida, was briefed on the false alert. White House spokeswoman Lindsay Walters said it “was purely a state exercise.” A senior U.S. official told The Washington Post that Trump was at the golf course at Mar-a-Lago when the alarm was sounded and knew “soon after” that it had been determined false.

Hawaii House Speaker Scott Saiki said the system Hawaii residents have been told to rely on failed miserably. He also took emergency management officials to task for taking 30 minutes to issue a correction, prolonging panic.

“Clearly, government agencies are not prepared and lack the capacity to deal with emergency situations,” he said in a statement.

The alert caused a tizzy on the islands and across social media.

At the PGA Tour’s Sony Open on Oahu, Waialae Country Club was largely empty and players were still a few hours from arriving when the alert showed up. Workers streamed into the clubhouse trying to seek cover in the locker room, which was filled with the players’ golf bags, but instead went into the kitchen.

Brian Naeole, who was visiting Honolulu, said he wasn’t worried since he didn’t hear sirens and neither TV nor radio stations issued alerts. “I thought it was either a hoax or a false alarm,” he said.

Others were outraged.

Hawaii ’s U.S. Sen. Brian Schatz tweeted the false alarm was “totally inexcusable.”

“There needs to be tough and quick accountability and a fixed process,” he wrote.

Federal Communications Commission Chairman Ajit Pai said on social media the panel would launch an investigation.

With the threat of missiles from North Korea, the state reintroduced the Cold War-era warning siren tests last month.

But there were problems there, too. Even though the state says nearly 93 percent of 386 sirens worked properly, 12 mistakenly played an ambulance siren. In Waikiki, the sirens were barely audible, prompting officials to add more sirens there and to reposition ones already in place.

The Washington Post contributed.