Television images shortly after the earthquake showed that people left their homes in the early hours of the morning after the earthquake.
Hokkaido Electric said that 2.95 million homes had lost power after the earthquake.
"The government will work in unison for reconstruction and will give the highest priority to saving human lives," Prime Minister Shinzo Abe told reporters.
The authorities warned of the risk of new tremors.
"Large earthquakes often occur, especially within two or three days (of a large one)," said Toshiyuki Matsumori, who is in charge of monitoring earthquakes and tsunamis at the meteorological agency.
He added that the risk of landslides and landslides had increased in the area affected by the earthquake, and he said: "We urge residents to pay full attention to seismic activity and precipitation and not to enter dangerous areas."
Japan sits on the "Ring of Fire" of the Pacific, where many of the earthquakes and volcanic eruptions of the world are recorded.
In June, a deadly tremor shook the Osaka region, killing five people and wounding more than 350.
On March 11, 2011, a devastating earthquake of 9.0 magnitude shook the Pacific Ocean and the resulting tsunami caused widespread damage and claimed thousands of lives.
Japan is still recovering from the worst typhoon that hit the country in 25 years, which hit the western part of the country on Tuesday, claiming at least 11 lives and causing major damage to the region's main airport.