Shandong TV reported that 126 houses had collapsed as of 7am.
All of the injured were being treated at Pingyuan County First People’s Hospital.
The tremors were reported in several areas in northern China, including Beijing and Tianjin and the provinces of Henan and Hebei.
The quake shook furniture in homes and sent residents seeking refuge outside, according to videos posted online.
Emergency workers respond to the quake in Pingyuan county on Sunday morning. Photo: Xinhua
Liu Xiqiang, deputy director of the Shandong Earthquake Agency, said it was the first time that an earthquake of magnitude five or higher had struck within 50km of the county.
Liu added that the possibility of a bigger aftershock was low.
Authorities in Pingyuan said they temporarily cut gas supplies in the county in case the quake had damaged pipelines.
Dozens of services on the Beijing-Shanghai high-speed rail line – the nation’s busiest – which passes through the quake zone, have been delayed or suspended, according to China Railway Beijing Group.
Authorities in Shandong province launched an emergency response and set up a joint command with the local government to take charge of disaster relief.
The State Council’s earthquake relief headquarters and the Ministry of Emergency Management also sent teams to work at the quake site.
The Beijing Earthquake Agency said the quake in Shandong would not affect Beijing in the short term.