A 7.1 magnitude earthquake has hit Alaska, with the threat of a devastating tsunami forcing residents to flee.

The huge earthquake hit just south west of Alaska which struck at 6:55 am EDT and was 22.1 miles deep, according to the U.S. Geological Survey.

People living in coastal areas have been told to leave their homes immediately and flee inland to higher ground after quake struck close to the Aleutian Islands, 1,031 miles away from Anchorage.

The National Oceanic and Atmospheric Administration (NOAA) has issued a warning telling residents should flee their homes immediately.

“Those feeling the earth shake, seeing unusual wave action, or the water level rising or receding may have only a few minutes before the tsunami arrival and should move immediately.”

“Homes and small buildings are not designed to withstand tsunami impacts. Do not stay in these structures,” the warning said.

Widespread damage is feared between British Columbia, Canada, to Washington, with towns bracing themselves. NOAA warned a tsunami could strike about 9am local time.