A major earthquake collapsed buildings and sparked fires in Japan's southwest.

Japanese emergency workers battled Thursday to rescue any remaining survivors from a devastated shopping mall, as the death toll from a major earthquake hit 30 and thousands sweltered in punishing heat.

Prime Minister Sanae Takaichi issued the new tally as Kumamoto officials said they have now extracted four bodies from the mass of rubble, steel and wires of the Aeon shopping mall after a suspected gas blast following Tuesday's quake.

At the mall, "we have pulled out 10 people. Of them, four were confirmed dead. Another is without vital signs. Another five have suffered severe and minor injuries", an official from disaster management office in the southwestern region told AFP.

Tuesday's 7.1-magnitude tremor caused widespread damage, flattening homes, damaging bridges, triggering fires and leaving tens of thousands of residents without power and water in temperatures forecast to hit 38C this weekend.