A more powerful earthquake has rocked the southern Japanese city of Kumamoto in the middle of the night, a day after an earlier tremor killed nine people.
The magnitude-7.3 quake hit at a depth of 10km (six miles) at 01:25 on Saturday (15:25 GMT on Friday) in Kyushu region. At least three people died and hundreds were injured.
A village has been evacuated after a dam collapsed, media reports say.
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 Kyushu 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 one town near the coast, the city hall has been so badly damaged there are fears it could collapse. A hospital has been evacuated because it is no longer safe.
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 inside an old people’s home.
Public broadcaster NHK says the dam collapsed in the Nishihara village.
Television pictures showed thousands of people filling streets and parks, looking dazed across the region.
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.
Gavin Hayes, a research geophysicist with the US Geological Survey (USGS) in Colorado, told the BBC that the latest earthquake would hamper the earlier rescue operation that was already under way.
He said more damage could be expected as the earthquake had been shallower and the fault-line had been much longer.
“The ground surface would have moved in the region of 4-5m (yards). So, you are talking very intense shaking over quite a large area. And that’s why we’ll probably see a significant impact from this event.”
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.