By Agence France-Presse
Multiple, large-scale landslides struck the sparsely populated countryside, which was also hit by the edge of a powerful typhoon that surged through Japan earlier this week.
Aerial views showed dozens of houses destroyed at the bottom of a hill that was engulfed by a landslide, with a rescue helicopter winching a resident to safety.
Around three million homes lost power after the quake damaged a major thermal plant supplying the region.
The Tomari nuclear power plant in Hokkaido, which was not operational before the quake, was forced to turn to emergency back-up power to keep its cooling system working, NHK said.
Kazuo Kibayashi, 51, a town official at hard-hit Abira town, told AFP: "There was a sudden, extreme jolt. I felt it went sideways, not up-and-down, for about two to three minutes."
"It stopped before shaking started again. I felt it come in two waves. I am 51, and I have never experienced anything like this. I thought my house was going to collapse. Everything inside my house was all jumbled up. I didn't have time to even start cleaning," he added.
Moments after the initial quake, an aftershock measuring 5.3 rocked the area and dozens more aftershocks followed throughout the night and into the morning.
Akira Fukui, from the main city of Sapporo, told AFP: "I woke up around 3am with a vertical jolt. I put the light on but it went out shortly afterwards. All the traffic lights are out and there's no power at work."
No tsunami warning was issued after the relatively shallow quake, which struck 62 kilometres (39 miles) southeast of the regional capital Sapporo.
Around 20,000 rescue workers, including police and members of the Self-Defence Forces were responding to the disaster, government spokesman Yoshihide Suga said. Another 20,000 SDF troops are expected to join the effort.
"We will do our best to save lives," Prime Minister Shinzo Abe said after an emergency cabinet meeting.
NHK reported that eight people had lost their lives, six of them in the village of Atsuma, where the landslide engulfed the homes. Nearly 40 people were still missing, the broadcaster added.
Local media said the dead also included an 82-year-old man who fell down the stairs at his home during the quake and that around 130 people had sustained minor injuries.
"I urge people in areas shaken by strong quakes to stay calm, pay attention to evacuation information... and help each other," Suga added.
Japan is still recovering from the worst typhoon to hit the country in 25 years, which struck the western part of the country on Tuesday, claiming at least 11 lives and causing major damage to the region's main airport.
'Ring of fire'
Officials warned of the danger of fresh quakes.
"Large quakes often occur, especially within two to three days (of a big one)," said Toshiyuki Matsumori, in charge of monitoring earthquakes and tsunamis at the meteorological agency.
The risk of housing collapses and landslides had increased, he said, urging residents "to pay full attention to seismic activity and rainfall and not to go into dangerous areas."
The earthquake also caused travel disruption, with all flights cancelled from Sapporo's main Chitose airport, where the quake brought down part of a ceiling and burst a water pipe. Local buses and trains and bullet train services were halted.
Industry Minister Hiroshige Seko said it would take "at least a week" for power to be restored to nearly three million homes after a fire in the area's largest thermal plant was discovered.
And the national meteorological agency warned that more bad weather could be on the way for Hokkaido, urging people to be vigilant for landslides, high tides and heavy rain.
Japan sits on the Pacific "Ring of Fire" where many of the world's earthquakes and volcanic eruptions are recorded.
In June, a deadly tremor rocked the Osaka region, killing five people and injuring over 350.
On March 11, 2011, a devastating 9.0-magnitude quake struck under the Pacific Ocean, and the resulting tsunami caused widespread damage and claimed thousands of lives.