There were no immediate reports of injury.
It was felt as far away as Durban, on South Africa's coast, and Harare, in central Zimbabwe.
The US Geological Survey (USGS) said the magnitude 7.5 quake had an epicentre 140 miles southwest of Mozambique's main port, Beira, at 12.19am (2219 GMT Wednesday).
A magnitude of 7 is considered a major earthquake capable of widespread and heavy damage.
Elias Daudi, Mozambique's national director of energy, said on state radio that the authorities still do not have information on casualties or damage. He urged people not to return to their buildings because of possible aftershocks.
Rafael Abreu, of the USGS's National Earthquake Information Centre in Golden, Colorado, said at least five aftershocks were immediately recorded and more were expected in coming days.
The earthquake occurred near the southern end of the East African rift system, a seismically active zone. Since 1900, the largest quake measured on the rift system had a magnitude-7.6, according to the USGS website.
Mozambican state radio said the quake was centred near Espungabera, a small farming town in a remote and sparsely populated area near the border with Zimbabwe.
In Beira, a hotel manager said mainly South African tourists had run terrified from their rooms when the building began moving.
Johana Neves, the manager at Tivoli Hotel, said nobody was hurt and nothing was damaged.
"It felt like you were in a boat, it was shaking everything yet, it's strange, nothing is broken, even the windows"
manager, Tivoli Hotel
"It felt like the building was going to fall down and it went on for a long time, the trembling," she said.
"It felt like you were in a boat, it was shaking everything yet, it's strange, nothing is broken, even the windows."
She said panicked guests had returned to their rooms. But Antonio Dinis, who also works at the hotel, said the streets were full of people afraid to go back home or sleep.
Storms and flooding killed at least 13 people this month in Mozambique, where the United Nations warned that natural disasters, food shortages and high Aids rates were threatening the country's chances of throwing off the shackles of a long civil war.
Mozambique, one of the world's poorest countries, suffers from frequent flooding. In 2000 and 2001, floods killed more than 800 people, left hundreds of thousands homeless and severely damaged roads and bridges.
The quake was shallow, which increases the potential for damage, said Dale Grant, a geophysics at USGS.
"It was felt very widely in the epicentral area, though it's not a very heavily populated area," Grant said. "There is certain to be damage, but so far, we've had absolutely no word of damage."