Two police officers and the suspected gunman were among the dead, while at least three other people were injured in the incident. A police statement said Liu Shuangrui opened fire in a village in Suning county with a double-barrelled shotgun. He was later shot dead.
Mass shootings are rare in China, where firearms access is strictly controlled.
The Xinhua news agency said Mr Liu, 55, first shot dead two of his neighbours in the rural farming district.
When police arrived he again opened fire, killing the two officers and injuring two others. Media reports say he was shot by police at the scene.