A more powerful earthquake has rocked the southern Japanese city of Kumamoto in the middle of the night, after an earlier tremor killed nine people.
The magnitude-7.3 quake at a depth of 10km (6 miles) hit at 01:25 on Saturday (15:25 GMT on Friday), causing some damage but no casualties.
A dam damaged by the earthquake is flooding a village which has been evacuated, public broadcaster NHK says.
A tsunami warning was issued, and lifted some 50 minutes later.
Japan is regularly hit by earthquakes but stringent building codes mean that they rarely cause significant damage.
This new earthquake in the Kyushu region of south-western Japan was much bigger and hit a wider area than the one that struck Kumamoto on Thursday night, says the BBC’s Rupert Wingfield-Hayes in Tokyo.
In the darkness it is hard to assess how bad the damage has been, our correspondent says.
But in one town near the coast, the city hall has been so badly damaged there are fears it could collapse. A hospital is being evacuated because it is no longer safe.
TV pictures have shown a whole neighbourhood ablaze.
Thousands of people have fled on to the streets and into parks – where they are huddled under blankets looking dazed and afraid, our correspondent says.
But there are numerous reports of people trapped inside buildings, including at least 60 people trapped inside an old people’s home.
Live television pictures from the scene showed thousands of people filling streets and parks, looking dazed and afraid.
Aftershocks are continuing to hit the area, making the job of rescuing people even harder, our Tokyo correspondent says.
NHK had warned of sea waves of up to 1m (3ft).
Japan’s nuclear authority said the Sendai nuclear plant was not damaged.
The quake was originally assessed as magnitude-7.1 but revised upwards to 7.3 later.
The Associated Press news agency said guests at the Ark Hotel near the Kumamoto Castle, which was damaged, woke up and gathered in the lobby for safety.
Thursday’s magnitude-6.2 quake caused shaking at some places as intense as the huge earthquake that hit the country in 2011, Japan’s seismology office said.
That quake sparked a huge tsunami and nuclear meltdown at a power plant in Fukushima.
Most of those who died in Thursday’s quake were in the town of Mashiki where an apartment building collapsed and many houses were damaged.
More than 1,000 people were injured.
Some 40,000 people had initially fled their homes, with many of those closest to the epicentre spending the night outside, as more than 130 aftershocks had hit the area.
Analysis: Jonathan Amos, BBC science correspondent
Japan is one of the most seismically active areas on Earth, accounting for about 20% of global quakes of magnitude 6.0 or greater. Seismometers are recording some kind of event every five minutes, on average.
It is through bitter experience that Japan has learnt the strategies to mitigate damage, injury and death. Not only does it implement some the best building construction practices but it has also established an early warning network.
This system relies on the lightning analysis of the developing quake, establishing its location and strength. Alerts are then broadcast that can give people more distant from the epicentre vital seconds’ notice.
Just 10 seconds is more than sufficient to drop and get under a sturdy table or open the doors of a fire station.
The prospect of buildings already damaged in Thursday’s quake toppling over in this latest tremor will be a concern.