MENTASTA, ALASKA - NOVEMBER 4: One of the large cracks on the Tok Cutoff Highway, caused by an 7.9 magnitude earthquake on November 3 that rocked a sparsely populated area of interior Alaska, is seen November 4, 2002 near Mentasta, Alaska. The earthquake, one of the most powerful earthquakes ever recorded in the United States, knocked out some of the pipelines supports forcing the flow of oil to be shut down. (Photo by Alaska Department of Transportation/Getty Images)

ANCHORAGE, Alaska (AP) — A 7.0 magnitude earthquake has rocked buildings in Anchorage and caused lamp posts and trees to sway, prompting people to run out of offices and seek shelter under office desks.

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

An Associated Press reporter working in downtown Anchorage saw cracks in a 2-story building after the quake.

It was unclear whether there were injuries.

People went back inside buildings after the earthquake but a smaller aftershock a short time later sent them running back into the streets again.

Officials issued a tsunami warning for coastal areas of southern Alaska but later canceled it.

National Tsunami Warning Center senior technician Michael Burgy said the tsunami warning was automatically generated.

Officials monitored gauges to see if any underwater landslides would generate tsunami waves.

Because there were none, the warning was canceled.

Police had told residents of the island community of Kodiak to head to higher ground.

The quake damaged buildings in Anchorage and buckled roads and sent people running into the streets.

There were no immediate reports of serious injuries or deaths.