The quake hit Guangxi's Liuzhou city at 12.21am (1621 GMT), state news agency Xinhua said, adding that one person remained missing as of the morning.
State broadcaster CCTV identified the deceased as a couple -- a 63-year-old man and a 53-year-old woman -- and said search and rescue efforts for the missing person were ongoing.
Authorities had evacuated over 7,000 people from the area, it added.
Videos published by CCTV showed people fleeing high-rise buildings and piles of rubble next to destroyed homes.
Rescue workers were seen trudging through the debris, while their dogs tried to sniff out signs of life.
Emergency workers wearing helmets were also seen using earthmovers to clear the wreckage.
Earthquakes in China are relatively common.
Last January, a devastating quake in the remote Tibet region killed at least 126 people and damaged thousands of buildings.