A 5.8-magnitude earthquake hit southwest China's mountainous Yunnan province late Tuesday, the US Geological Survey (USGS) said.