Homeowner Eric Nelius shared the footage from a camera at his home in Palmer, Alaska, about 40 miles northeast of Anchorage. The footage showed about 20 seconds of intense shaking; Nelius' wife can be seen grabbing the couple's son and running toward the front door until the shaking subsides.
Nelius, who felt the shaking approximately 300 miles away in Fairbanks, said there was "just broken stuff at our house" after the earthquake.
VIDEO: Moment earthquake strikes at Ted Stevens Anchorage International Airport
The U.S. Geological Survey said the first and more powerful quake was centered about 7 miles north of Anchorage, Alaska's largest city, with a population of about 300,000. People ran from their offices or took cover under desks.
People went back inside after the first earthquake struck, but the 5.8 aftershock about five minutes later sent them running back into the streets.
A tsunami warning was issued and later canceled for the southern Alaska coastal areas of Cook's Inlet and part of the Kenai Peninsula. Kodiak police on Kodiak Island warned people in the city of 6,100 to "evacuate to higher ground immediately."
The Associated Press contributed to this report.