Image credit Getty Images.
The quake struck 91 km southeast of the town of Perryville, according to the U.S. Geological Survey.
The quake struck at 22:15 on Wednesday (0615 GMT Thursday). Perryville is a small town located about 800 kilometers from Anchorage, Alaska's largest city.
The U.S. government's National Tsunami Warning Center immediately issued a tsunami warning for southern Alaska and the Alaska Peninsula.
It first warned of dangerous waves. About two hours later, it reported that the maximum expected tsunami height would be less than 30 centimeters above high tide.
Tsunami warning sirens sounded on Kodiak Island, an island of about 6,000 people off the coast of Alaska.
The warning center reported that a possible tsunami would hit Kodiak around 11:55pm.
That time passed without a tsunami, according to an announcer at local radio station KMXT.
Journalists and Kodiak residents posted videos on social media showing people moving away from shore as warning sirens wailed.
A tsunami warning was initially issued in Hawaii, meaning residents should stay away from beaches, but was lifted after about two hours.
Five aftershocks were recorded within 90 minutes of the quake, the strongest of which had a magnitude of 6.2, according to the U.S. Geological Survey.
Alaska is part of the seismically active Pacific Ring of Fire.
In March 1964, Alaska experienced a 9.2 earthquake, the strongest ever recorded in North America.
It devastated Anchorage and generated a tsunami that struck the Gulf of Alaska, the west coast of the United States and Hawaii.
The earthquake and tsunami killed more than 250 people.
A magnitude 7.5 earthquake also generated tsunami waves off the southern coast of Alaska in October, but no casualties were reported.