The statement yesterday on the official website for the city of Chongzuo did not identify the religion, but Chinese authorities usually blame religious extremism for violence involving members of the Muslim ethnic minority of Uighurs in the country's far west region of Xinjiang.
Beijing also warns that religious extremists have been seeking to leave China to train with militant groups.
The Chongzuo government said police received a tip that the group was to enter Vietnam through the border town of Pingxiang and that they ambushed the group's two vehicles on Sunday night.
Two officers immediately shot and killed that person, the statement said, and police reinforcements helped detain the 21 others.
More From This Section
The policeman was recovering at a local hospital, the statement said.
In the past 20 months, about 400 people have been killed in violence in and outside Xinjiang, according to state media reports, and China is in the middle of a one-year clampdown on what it says are terrorist activities in the region.
Beijing has blamed the violence on Islamic militants with foreign connections and seeking an independent state in Xinjiang. The government says some of them are fleeing the country to join the Jihad, although critics say the Uighurs are discriminated and economically marginalized on their homeland and that they are seeking to escape from the repressive rule by the majority Han Chinese.