People return home from Sitka High School after evacuating Tuesday, Jan. 23, 2018, in Sitka, Alaska after tsunami sirens and cell phone messages told residents to leave after a 7.9 magnitude earthquake struck in the Gulf of Alaska. The killer wave never materialized. (James Poulson/Daily Sitka Sentinel via AP)
People return home from Sitka High School after evacuating Tuesday, Jan. 23, 2018, in Sitka, Alaska after tsunami sirens and cell phone messages told residents to leave after a 7.9 magnitude earthquake struck in the Gulf of Alaska. The killer wave never materialized. (James Poulson/Daily Sitka Sentinel via AP) Credit: JAMES POULSON

Anchorage, Alaska — A powerful undersea earthquake sent Alaskans fumbling for suitcases and racing to evacuation centers in the middle of the night after a cellphone alert warned a tsunami could hit communities along the state’s southern coast and parts of British Columbia.

The monster waves never materialized, but people who fled endured hours of tense waiting at shelters before they were cleared to return home.

“This was a win as far as I could tell,” said Marjie Veeder, clerk for the city of Unalaska, which is home to the international fishing port of Dutch Harbor in the Aleutian Islands. “We got advance warning and were so thankful for that.”

The magnitude 7.9 quake in the Gulf of Alaska triggered the jarring alert that roused people shortly after midnight on Tuesday. Fleeing motorists clogged some highways in their rush to higher ground. Many took refuge at schools or other shelters.

Even for Alaskans accustomed to tsunami threats and tsunami drills, the phone message was alarming. It read: “Emergency Alert. Tsunami danger on the coast. Go to high ground or move inland. Listen to local news.”

There were no reports of damage, not even on Kodiak Island, the closest land to the epicenter. Only after the all-clear was sounded did a little levity emerge. In Kodiak, a customer’s Facebook post suggested a post-evacuation meal at King’s Diner: “Hungry? Tsunami got you up early?”

Eleanor King opened the diner at the usual time of 6 a.m.

By the time customers started arriving, the excitement had passed and people just sat around quietly eating their meals, speaking little of the quake.

The temblor reminded King of a deadly 1964 quake that generated tsunamis that killed 129 people and wreaked widespread devastation — events that remain vivid in the memories of many Alaskans.

“It started out just like the big one,” she said. “It was very slow and rolling, a good resemblance to the big one. That’s what scared us.”

Tuesday’s quake was recorded at 12:32 a.m. in the Pacific Ocean about 170 miles southeast of Kodiak, home to one of the nation’s largest Coast Guard bases.

It prompted the warning across thousands of miles of Alaska’s southern coast, from Attu in the Aleutian Islands to Canada’s border with Washington state.

Kodiak is about 200 miles south of Anchorage, the state’s largest city, which was not under a tsunami threat.

Elsewhere in the United States, Washington state, Oregon, California and Hawaii were under tsunami watches, which eventually were lifted. Officials in Japan say there was no tsunami threat there.

The state has an active tsunami-readiness program, and many communities have sirens and evacuation plans.

In British Columbia, sirens blared and officials banged on doors to wake people from their sleep as a tsunami warning was issued along a large swath of the Canadian province’s coastline.