ANCHORAGE, Alaska -- A 7.9 magnitude earthquake struck off Alaska's Kodiak Island early Tuesday, prompting a tsunami warning for a large swath of the state's coast and Canada's British Columbia, and watches for the rest of the U.S. West Coast and Hawaii. Officials at the National Tsunami Center canceled the warning after a few tense hours after waves failed to show up in coastal Alaska communities.

The strong earthquake hit at 12:30 a.m. and was recorded about 170 miles southeast of Kodiak Island in the Gulf of Alaska. Kodiak Island is located about 200 miles southwest of Anchorage, Alaska's largest city, which was not under a tsunami threat. Reports varied about how long the shaking lasted. In the popular cruise ship town of Seward, about 230 miles northeast of Kodiak Island, fire chief Eddie Athey said the quake felt like a gentle rattle and lasted for up to 90 seconds.

There were no immediate reports of damage, not even on Kodiak Island, the closest land to the epicenter of the quake.

Get Breaking News Delivered to Your Inbox

Initially, the USGS said the earthquake was a magnitude 8.2. That prompted the tsunami warning for coastal Alaska and Canada's British Columbia, while the remainder of the U.S. West Coast was under a watch.

A tsunami warning for the southern coastline of Alaska -- from the Aleutian Islands to Southeast Alaska -- was downgraded to a tsunami advisory for the coastline east of Seward to Chignik Bay. It was later canceled, CBS Anchorage affiliate KTVA-TV reported.

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.

For Alaskans accustomed not only to tsunami threats but also to regular drills, the early morning alert that made cellphone alarms go off still created some fretful moments. The phone message read: "Emergency Alert. Tsunami danger on the coast. Go to high ground or move inland."

Keith Perkins got the phone alert and later heard sirens going off in his southeast Alaska hometown of Sitka. He said people on Facebook were talking about whether the threat was real and what they should do.

Given the magnitude of the earthquake, Perkins said, he thought it best to head to the high school, a tsunami evacuation point, even though in the past he felt his home was at a "high-enough spot."

"I figured I'd probably just better play it safe," he said.

Vehicles are seen evacuating Kodiak, Alaska, in wake of tsunami warning issued after powerful earthquake 175 miles southeast of Kodiak Island early on Jan. 23, 2018 @Jupiter00000

People reported on social media that the quake was felt hundreds of miles away, in Anchorage. Reports varied about how long the quake's shaking lasted, depending on location.

In the popular cruise ship town of Seward, about 110 miles south of Anchorage, Fire Chief Eddie Athey said the quake felt like a gentle rattle that lasted for up to 90 seconds.

"It went on long enough that you start thinking to yourself, 'Boy, I hope this stops soon because it's just getting worse,'" Athey said.

The earthquake woke Kodiak Police Lt. Tim Putney from a dead sleep. He said it shook for at least 30 seconds but admits his estimate might be skewed by sleeping through some of it.

"I've been in Kodiak for 19 years that was the strongest, longest-lasting one I've ever felt," he said by telephone.

John Bellini, a geophysicist with the U.S. Geological Survey's National Earthquake Information Center, said there had been more than two dozen aftershocks as of about 6:30 a.m. The biggest aftershock had a magnitude of 5.3.

The earthquake was initially reported as magnitude 8.2, but Bellini said as more data comes in, better calculations can be made. Earthquake waves take time to spread.

Kodiak was projected to get the first tsunami wave, and officials warned residents to evacuate if they lived in low-lying areas. Some people sought refuge in schools. The wave never materialized there or in other coastal communities like Homer and Seward, and the warning was soon canceled.

Larry LeDoux, superintendent of the Kodiak Island Borough School District, said schools were open as shelters and estimated there were about 500 people at the high school. He described the atmosphere inside as calm, with people waiting for updates.

He said sirens go off in the community every week as a test to make sure they are working.

In Seward, at the southern end of Alaska's Kenai Peninsula, residents retreated to higher ground or left on the only road out of the city, the fire chief said. He described it as a controlled evacuation and compared it to people driving home from a holiday fireworks show.

Officials later tweeted: "National Tsunami Warning Center has CANCELLED the Tsunami Watch for San Francisco."

National Tsunami Warning Center has CANCELLED the Tsunami Watch for San Francisco. Check your email for more informa https://t.co/LH5QIHH0jQ — San Francisco DEM (@SF_emergency) January 23, 2018

The U.S. Geological Survey tweeted an explanation of what caused the quake: