BEIJING (Reuters) - Attackers drove a car into a government building in China's unruly far western region of Xinjiang on Wednesday and set off an explosive device killing one person, while all four of the attackers were shot dead, the regional government said.

Hundreds of people have been killed over the past years in resource-rich Xinjiang, on the borders of central Asia, in violence between the Muslim Uighur people who call the region home and ethnic majority Han Chinese.

The government has blamed the unrest on Islamist militants, though rights groups and exiles say anger at Chinese controls on the religion and culture of Uighurs is more to blame for the unrest. China denies any repression in Xinjiang.

In a short statement on its main news website, the Xinjiang government said the incident occurred just before 5 p.m. (0900 GMT) in Karakax county, deep in southern Xinjiang's Uighur heartland.

It said the four "thugs" drove a vehicle into a yard at the county Communist Party offices and detonated an "explosive device", but were all shot dead.

Three people were injured and one other died, it added, without giving details.

"At present, local social order is stable," the government said.

In a separate English language report, the official Xinhua news agency described the incident as a "terrorist attack". It gave no other details aside from those in the government statement.

Xinjiang had generally been quiet this year, with no major reported attacks or other violent incidents.

(Reporting by Ben Blanchard; Editing by Alison Williams)