Germany's GFZ center for geosciences said the epicenter of the earthquake was in neighboring Myanmar, citing preliminary reports. It was recorded at a shallow 10 kilometers (6.2 miles).
The United States Geological Survey (USGS) said the earthquake had a 7.7 magnitude, with a 6.4 magnitude aftershock following closely behind.
Deaths were reported in both Thailand and Myanmar, but precise tolls remained unclear.
The Thai prime minister reportedly declared a state of emergency in Bangkok, while Myanmar declared an emergency in the capital and its second-largest city.
What else do we know about the earthquake?
Witnesses said people ran out into the streets of Bangkok after feeling the powerful tremors.
A highrise building under construction collapsed in Bangkok due to the earthquake, police told the Associated Press news agency. The French AFP news agency cited medics as saying 43 workers were trapped.
Thai emergency responders were quoted by the AP as saying at least two bodies were found dead while seven others were found alive. An unknown number of others were under the rubble.
"When I arrived to inspect the site, I heard people calling for help, saying help me," Worapat Sukthai, deputy police chief of Bang Sue district, told AFP. "We estimate that hundreds of people are injured but we are still determining the number of casualties," he said.
Bangkok Governor Chadchart Sittipunt was quoted by the Reuters news agency as saying that the tremor caused damage to many high-rise buildings in the Thai capital, with inspections underway to find out the number of buildings affected. The governor urged caution.
Some metro and light rail lines were suspended as a result of the quake.
"I heard it and I was sleeping in the house, I ran as far as I could in my pyjamas out of the building," Duangjai, a resident of popular tourist city Chiang Mai, told AFP after tremors were felt across northern and central Thailand.
Thai Prime Minister Paetongtarn Shinawatra said she interrupted an official visit to the southern island of Phuket to hold an "urgent meeting."
Thailand's stock exchange announced coming to a full halt after the quake.
Where else were the tremors felt?
The earthquake's epicenter was located 16 kilometers northwest of the city of Sagaing in Myanmar at around 12:50 p.m. local time (0620 GMT/UTC), the USGS said.
An AFP journalist in the city of Naypyidaw, south of Sagaing, said roads were buckled by the force of the earthquake, with chunks of ceilings fallen from buildings.
"We have started the search and going around Yangon to check for casualties and damage. So far, we have no information yet," an officer from the Myanmar Fire Services Department told Reuters. Yangon lies some 620 kilometers south of Sagaing.
Unverified social media posts also showed damage in Mandalay, Myanmar's second-largest city and ancient royal capital that is at the center of its Buddhist heartland.
"We all ran out of the house as everything started shaking," a witness in the city told Reuters. "I witnessed a five-storey building collapse in front of my eyes. Everyone in my town is out on the road and no one dares to go back inside buildings."
A mosque also partially collapsed in Myanmar, with deaths reported, though a clear toll was still unavailable.
Apart from Thailand, the tremors were also felt in China's southwest Yunnan province. Beijing's quake agency measured the jolt at 7.9 in magnitude.
China's Foreign Ministry said it was closely following reports on the tremors.
In India, Prime Minister Narendra Modi said his country was on standby to offer help to Myanmar and Thailand.