Officers discovered a group of Uighurs near a highway toll gate and two who "assaulted" the officers with knives were shot dead, the government-run China News Service said.
Uighurs are a Turkic-speaking and mostly Muslim ethnic minority, whose resource-rich homeland Xinjiang has seen intensifying and increasingly sophisticated attacks, sometimes spreading beyond it.
Two more people were detained while police were still searching for a fifth in Pingxiang city in the southern region of Guangxi, the official Xinhua News Agency reported.
Calls to the Pingxiang municipal public security bureau by AFP went unanswered.
At least 200 people have been killed in a series of clashes over the past year linked to Xinjiang, with authorities blaming religious extremists and separatists.
Rights groups argue that harsh police treatment of the Uighur minority, as well as government campaigns and bans against religious practices such as the wearing of veils, have led to violence.
"China is using extreme means like shooting and killing these people in order to intimidate other Uighurs who wish to escape," Dilxat Raxit, spokesman for the Munich-based World Uyghur Congress.
"There is a direct relationship between China's repressive policies and the increase in those trying to escape."
Hundreds of people believed to be Uighurs were detained in Thailand last year, claiming they were Turkish citizens in order to avoid being sent back to China. Chinese authorities launched a crackdown on illegal emigration in the wake of their case.
Uighurs are sometimes denied passports for travel by officials and have sought to cross China's southern border, where established human-smuggling networks operate. Xinjiang's militarised frontiers and harsh mountain terrain also discourage illegal migration directly to Central Asia.
Beijing has responded to Xinjiang-related violence with a severe crackdown in recent months, with hundreds of arrests and around 50 executions and death sentences publicly announced since June.