A vice-mayor of Datong, a city in Shanxi known as China's 'coal capital', was killed by a brother-in-law on Saturday night, the city government said.
Wang Weiguo, who became a vice-mayor of the city in November 2010, was murdered by his wife's brother, Zhou Yun, in the residential community where he lived, it said.
Zhou, in his late 50s, was detained by police on Sunday and confessed to the crime.
He had been a migrant worker in Yunnan since 2007 and had unsuccessfully tried to press Wang several times to use his power and connections to find him a job in a public institution and to also help his son change jobs, the government said.
The Today Morning Express quoted Gu Shengming, the director of the Datong government's news centre, as saying that Zhou had previously worked at Datong's Third Grain Depot but had left to make a living in Yunnan because business at the depot was poor.
The news broke on Sunday when a microblogger posted an item saying that Wang had been killed on Saturday night.
It was updated five minutes later, saying: 'Wang Weiguo was bashed to death with a rock by his wife's brother, Zhou Yun, last night in the Yuxinghuadu community of Datong, Shanxi province, because of matters related to the sale of official positions.'
The news spread rapidly online and was confirmed by Datong's public security bureau later that day.
Wang was born in 1960 in Shanxi's Hunyuan county. As one of Datong's vice-mayors, his responsibilities covered areas including science and technology, education, culture, radio and television, the press and sport.
He had been the party chief of Shanxi's Zuoyun county, another major coal production base, for four years.