The shallow quake hit at 10:48 pm Saturday (0648 GMT Sunday), about 55 miles (89 kilometers) southwest of the small town of Sand Point, the agency added.
The National Tsunami Warning Center in Palmer, Alaska said a tsunami warning was in effect for south Alaksa and the Alaska peninsula.
“For other US and Canadian Pacific coasts in North America, the level of tsunami danger is being evaluated.”
Alaska is part of the seismically active Pacific Ring of Fire.
Alaska was hit by a 9.2-magnitude earthquake in March 1964, the strongest ever recorded in North America. It devastated Anchorage and unleashed a tsunami that slammed the Gulf of Alaska, the US west coast, and Hawaii. More than 250 people were killed by the quake and the tsunami.