The official Xinhua news agency says the 5.1-magnitude earthquake shook Yunnan 's Yanjin county Saturday morning .