Japanese media reported one of the quake's victims is a 9-year-old girl found at a school in Takatsuki City.
Osaka is one of Japan's largest port cities and is a major commercial center. A man in his 80s died in the collapse of a concrete wall in Osaka city.
Japanese government spokesman Yoshihide Suga says there were no reports of major damage as of 8:30 a.m.
Prime Minister Shinzo Abe told reporters the government was "working united, with its first priority on saving people's lives".
Some 170,000 households remain without power in Osaka, as well as neighboring Hyogo prefecture, according to local electricity operator Kansai.
A police officer stands guard at the site where a girl was killed by fallen wall caused by an natural disaster at an elementary school in Takatsuki, Osaka prefecture, western Japan, in this photo taken by Kyodo June 18, 2018. An 84-year-old man in nearby Ibaraki died after a bookshelf fell on top of him at home, according to city officials.
Peta's Forecast - Storm chances will follow weekend heat
This means a big warm up for our area, but the humidity will also increase.and risky heat index values can be expected. People should be aware of the signs of heat stroke or exhaustion, which include headache, nausea and muscle cramps.
Messi misses PK as Argentina draws Iceland
To further compound their problems, goalkeeper Sergio Romero and midfielder Manuel Lanzini both fell victim to late injuries. But the Icelanders revel in their underdog status and showed at Euro 2016 they will not be cowed on the big stage.
Donald Trump Wants "His People" To Treat Him Like Kim Jung
He said cancellation of the drills "is really a bad idea ... and (Trump) betrayed our people". He has the power to remove most State Department workers without oversight.
"There are fears that the risk of house collapses and landslides has increased in the areas shaken strongly", said Toshiyuki Matsumori, in charge of monitoring quakes at the agency.
Railway services in Osaka, Shiga, Kyoto and Nara, both high speed bullet trains and local rail services, were halted.
A massive magnitude 9.0 quake hit northeastern Japan on March 11, 2011, triggering a huge tsunami that killed some 18,000 people and triggered the world's worst nuclear disaster in a quarter of a century at Tokyo Electric Power's Fukushima Daiichi nuclear plant.
Kate Kilpatrick, visiting Japan for the first time from the United States, said alarms went off nearly immediately in the Osaka hotel she was staying and a loudspeaker told guests to stay away from windows.
A building burns after the quake in Osaka.
"We were sleeping and it woke us up abruptly", Kate Kilpatrick, who was staying in a hotel in Osaka, told Reuters.