A 5.8 magnitude earthquake hit Alaska about 75 miles (121 km) northwest of Anchorage on Wednesday at a depth of 71 miles (115 km), the U.S. Geological Survey reported.