A powerful earthquake has struck off Turkey's Aegean coast and north of the Greek island of Samos, destroying homes and killing at least 22 people.
The 7.0 magnitude tremor was centred off Turkey's Izmir province, the US Geological Survey (USGS) said.
Turkey put the magnitude lower, at 6.6, saying 20 people had died and 786 were injured in the province of Izmir. On Samos, two teenagers were killed.
The shallow tremor triggered a mini-tsunami that flooded Izmir and Samos.
The authorities in Izmir, the provincial capital, are now setting up a tent area to house about 2,000 people overnight, amid fears that more buildings could collapse.
The authorities said that 70 people had been rescued from under the rubble.
Rescuers continued to dig through concrete blocks after darkness fell, hoping to find more survivors.
The USGS said the quake - which was felt as far away as Athens and Istanbul - struck at a depth of 10km (six miles), although Turkish officials said it was 16km below ground.
Turkey and Greece both sit on fault lines and earthquakes are common.
In Izmir, Turkey's third largest city with the population of nearly three million, many people were seen running out into the streets in panic and fear after the quake struck. At least 20 buildings collapsed.
Videos have been posted on social media appearing to show the moment one multi-storey building went down, the BBC's Orla Guerin in Istanbul reports. Other footage shows local people scrambling over rubble looking for survivors.
There were reports of flooding in the city after the sea level rose, and some fishermen are said to be missing.
"It was a really strong shaker almost enough to knock you off your feet. Running out of the house with my children was like a drunken wobble," Chris Bedford, a retired British teacher who lives in Urla, west of Izmir, told the BBC.
One of the 20 confirmed victims drowned, the Turkish emergencies agency said.
Yasar Keles, an official in Sigacik, near Izmir, told BBC Turkish that a person died after their wheelchair was hit and overturned by the rising water.
Officials later said that 70 people had been rescued from under the rubble.
Turkish President Recep Tayyip Erdogan said the government would help those affected by the quake "with all the means available to our state".
In Greece, two teenagers were killed when a wall collapsed on Samos. Eight people were injured across the island.
A mini-tsunami flooded the port of Samos and a number of buildings were damaged. Greek officials put the magnitude of the tremor at 6.7.
"We felt it very strongly," local journalist Manos Stefanakis told the BBC, adding that smaller aftershocks were continuing.
He said it was the biggest tremor to have hit the island since 1904.
Fareid Atta, another Samos-based journalist, told the BBC that the damage was "quite extensive along the seafront" of the island's main town.
"Many businesses will be going under after this," he said.
Residents were urged to stay outdoors and keep away from coastal areas. About 45,000 people live on Samos.
'We were scared there would be a tsunami'
Jude Wiggins, co-ordinator at women's centre for refugees in Samos
The building began to shake in our centre so we ran out. Soon the roads began to flood.
We were scared there would be a tsunami so we ran up the hill.
I was in the kitchen. The washing machine was going and I thought it was just doing that thing when it shakes and moves around at first. But the fridge was moving.
I ran out. Women were running everywhere. For a lot of the women it's quite traumatic as they've come from places like Syria and it could have felt like they were being bombed or something.
At some point everybody started to run. People were panicking. Our house is not safe to stay in as there are a lot of cracks.
For the people in the camps, they've lost everything in their own countries, they lost everything again in a fire and now lots of them have lost the tents they were sleeping in.
Reports said Friday's quake was also felt on the Greek island of Crete.
Greek Prime Minister Kyriakos Mitsotakis said he called Mr Erdogan "to offer my condolences for the tragic loss of life from the earthquake that struck both our countries".
"Whatever our differences, these are times when our people need to stand together," Mr Mitsotakis wrote in a tweet.
Mr Erdogan later responded, also by posting a tweet.
"Turkey, too, is always ready to help Greece heal its wounds. That two neighbours show solidarity in difficult times is more valuable than many things in life," he added.
Relations between Greece and Turkey have been particularly strained in recent months by a dispute relating to control of territorial waters in the Mediterranean and the resources beneath them.
In January more than 30 people were killed and more than 1,600 injured when an earthquake struck Sivrice in Turkey's eastern Elazig province.
In July 2019, the Greek capital Athens was hit by a tremor that knocked out power to large parts of the city.
A powerful quake that struck the Turkish city of Izmit, near Istanbul, in 1999 killed about 17,000 people.
Are you in an area affected by the earthquake? If it is safe for you to do so share your experiences by emailing email@example.com.
Please include a contact number if you are willing to speak to a BBC journalist. You can also get in touch in the following ways: