ISTANBUL — A powerful earthquake in the Aegean Sea left at least 19 people dead Friday in Turkey and Greece, flattened at least 20 buildings in coastal Turkey and sent a surge of seawater flooding streets near the Turkish city of Izmir.

The magnitude 7.0 earthquake — felt as far away as Istanbul and Athens — occurred about 10 miles north of the Greek island of Samos, according to the U.S. Geological Survey.

At least 17 people were dead and more than 700 injured in Turkey, according to Turkey’s disaster management agency, which said one of the victims had drowned. At least 20 structures, including some multistory apartment buildings in Izmir, collapsed, and rescue crews and volunteers combed through the rubble into the night.

On Samos, two teenagers, a boy and a girl, were killed when a wall collapsed on them, said Greece’s General Secretariat for Civil Protection. Local media reported that the teens were walking home from school.

It was the second major earthquake to hit Turkey this year. In January, at least 41 people were killed in an earthquake that struck Elazig in central Turkey, where questions were raised about the whether the government was adequately enforcing building codes.

Some of the worst damage in Friday’s quake occurred in Izmir, a city of 4.4 million people on Turkey’s Aegean coast that is the country’s third-largest metropolis. Mayor Tunc Soyer told CNN Turk that search teams were at the scene of the collapsed buildings.

Local television stations showed residents and rescue workers searching for survivors through mounds of rubble. Plumes of white smoke rose from Izmir’s skyline. During one broadcast, cheers erupted as a woman, dazed and grimacing, was pulled from the ruins of a building.

Near Seferihisar, south of Izmir, coastal areas flooded with seawater from what appeared to be a “small tsunami,” said Ismail Yetiskin, a district mayor who was quoted by the NTV news channel.

The authorities had lost contact with several fisherman who were at sea when the earthquake struck, he said. Video posted on the Internet appeared to show flooding in Samos as well.

The quake was very shallow, with the main slip occurring just seven miles below the seabed. Most earthquakes in western Turkey occur within 40 miles below the surface.

Turkey sits atop the Anatolian plate, a block of the earth’s crust that is slowly rotating counterclockwise and shifting west with time — about an inch of movement every year. But pent-up stress caused by collisions with the African plate and Eurasian plate result in frequent earthquakes.

Most of Turkey’s big quakes over the years have occurred along the North Anatolian Fault, which runs across northern Turkey along the Pontic Mountains.

Occasionally, quakes occur in the country’s western zones, the result of dense, oceanic crust sinking and forcing the ground further east upward.

The quake was the strongest in nearly a decade to strike Turkey. In October 2011, a 7.1 earthquake struck eastern Turkey, killing more than 600 people.

On Samos, some residents were asked to evacuate their houses for the next 48 hours for precautionary reasons.

The earthquake struck at a moment when the governments of Turkey and Greece are locked in a bitter feud over competing claims to territory and resources in the seas that divide the two countries. After the quake, both nations issued offers of mutual humanitarian aid.

Writing on Twitter, Greek Prime Minister Kyriakos Mitsotakis said he had called Turkish President Recep Tayyip Erdogan to offer condolences.

“Whatever our differences, these are times when our people need to stand together,” Mitsotakis wrote.

Cappucci reported from Washington. Zeynep Karatas in Istanbul and Elinda Labropoulou in Athens contributed to this report.