An earthquake with a preliminary magnitude of 7.9 hit beneath the Gulf of Alaska early Tuesday, resulting in tsunami alerts for coastal areas from British Columbia to the Aleutians.

All Alaska warnings, alerts and advisories were canceled just after 4 a.m., and there were no reports of significant waves or damage.

The earthquake was a "strike-slip" quake that occurred on a fault deep undersea, according to Ken Macpherson, watchstander at the National Tsunami Warning Center in Palmer. That type of seismic event doesn't usually result in big tsunamis, unlike earthquake along subduction zones where one plate essentially rises off another abruptly, pushing up a lot of water.

This quake created a more horizontal, back-and-forth motion, Macpherson said. "Historically, these types of earthquakes have not generated huge tsunamis."

The Great Alaska Earthquake of 1964 was of the more dangerous subduction zone type, he said.

Tuesday's quake was centered 181 miles southeast of Kodiak, according to the Alaska Earthquake Center. The quake was 15.5 miles deep, the center said. The magnitude was initially reported to be about 6 miles deep and magnitude 8.2 but was later downgraded to 7.9.

The quake hit at 12:31 a.m., according to the USGS.

Before tonight, the M7.8 & 7.7 earthquakes in 1987 and 1988 were the largest earthquakes recorded within the Pacific plate in the Gulf of Alaska region. — AK Earthquake Center (@AKearthquake) January 23, 2018

The tsunami alert activated emergency warnings along coastal Alaska, and alerts were issued for residents to move to high ground. Sirens blasted in Kodiak and Homer, and people in communities from Sitka to Kodiak were evacuated. Authorities said there was no tsunami threat in Anchorage.

"Tsunami activity" with wave heights of less than 1 foot were recorded from Kodiak to Yakutat, according to the National Tsunami Warning Center.

A friend sent me this clip of the tsunami siren in Kodiak early this morning: pic.twitter.com/SzZUIMAWWM — Casey Kelly (@caseyriankelly) January 23, 2018

The quake woke people up in Anchorage, more than 350 miles from the epicenter, and was felt throughout the southern half of the state, as far away as Fairbanks.

One Kodiak man, Eric Cusson, said hundreds of people drove up Pillar Mountain, the site of the town's utility-scale wind turbines.

"Pretty much everyone in town went up Pillar Mountain," he said.

One of Cusson's friends said the Coast Guard appeared to have evacuated all the aircraft from their local base, which is on the waterfront.

"She saw all the C-130s and all the helicopters take off," he said.

On Kodiak, people also evacuated to the high school and the Walmart and Safeway parking lots.

Jared Griffin lives about a block from the water in the city of Kodiak. The tsunami sirens woke him up. In his 11 years living in town, this had never happened.

He said he woke his wife up. Then they both got tsunami alerts on their cellphones. They decided to wake up their three children and evacuate to the home of their in-laws on higher ground.

"It's so dark and where we are, we're behind some high ground, so we're fine but we really can't see anything," he said. "We've been trying to pull up some of the harbor cams but even there, they're really dark. You can't tell if the surf is receding or anything."

A man in the Kodiak community of Ouzinkie had more than 3,500 viewers watching his Facebook live stream from his vehicle in the dark above the waterfront as he listened to the radio and offered occasional commentary.

Larry LeDoux, superintendent at the Kodiak Island Borough School District, said around 1:40 a.m. that sirens blared in the city of Kodiak and hundreds of people had traveled to Kodiak High School, opened as an emergency shelter.

"There's probably 300 to 400 cars at the high school right now," he said.

"People are calm — very, very calm. At the high school it's pretty tight parking and people are letting people in and there's no sense of any kind of panic or anything. It's just something we've prepared for for years."

The Kodiak Island Borough School District said schools would be closed Tuesday.

In Homer, with a population of about 5,500, police were advising people to evacuate the low-lying spit that extends four miles into Kachemak Bay. Warning sirens went off just before 1 a.m.

Jon Faulkner, who owns a resort at the spit's tip, said staff and their half-dozen guests evacuated.

By 3:30 a.m., he said, they were "just waiting word from local authorities that it's safe to go back out."

"I'll probably be giving my staff the green light here in the next half hour if nothing happens," he said, citing the absence of waves reported along Alaska's coast.

Faulkner lives on West Hill, on higher ground. He said he'd seen 75 cars pass his house in 15 minutes.

"It's clearly got a lot of people freaked out," he said.

In Cordova, the fishing town on Prince William Sound, Mayor Clay Koplin said he was woken up by the earthquake — the strongest one he's ever felt.

At 3:15 a.m., he was at his office at the local electrical utility, "just kind of waiting." Most people had moved to high ground, he said, some to a local school and community center.

"A lot of people are going even higher – they're going up to the ski hill," he said.

At the Pit Bar in Seward, about two miles from the head of Resurrection Bay, bartender Steve Krouse said about 20 people arrived after the earthquake to what had been an empty room.

"Everybody here right now is just part of the mad exodus from town," he said. "I didn't feel the earthquake happen, but then I started getting calls and I just start seeing the line of cars coming in."

Sirens in town went off three times, Krouse added.