The U.S. Geological Survey says the earthquake was centered about 7 miles (12 kilometers) north of Alaska's largest city.