(Reuters) - China executed three accused separatists on Tuesday for their role in an attack that killed 31 people at a train station in the southwest last year, a court said.

The government has said the attack, in the city of Kunming, was carried out by knife-wielding separatists from the far western region of Xinjiang, which is located on the borders of Central Asia.

The three men who were executed, Iskandar Ehet, Turgun Tohtunyaz and Hasayn Muhammad, were sentenced to death in September after being convicted of homicide and leading a terrorist organization, the Kunming Intermediate People's Court said. A higher court later upheld the sentence, the official Xinhua news agency reported.

Police shot four other assailants dead during the knife attack, which injured 141 people on March 1, 2014.

Xinjiang, home to the Muslim Uighur minority group, has been plagued by unrest in recent years. Some Uighurs have chafed under Chinese restrictions on their culture and religion.

Dilxat Raxit, a spokesman for the exiled World Uyghur Congress, said the defendants were denied a fair trial.

"China's use of the death penalty as a political tool does not address the root of the problem," he said in an email to Reuters. "China continues to make use of this incident to incite discrimination against Uighurs."

The Chinese government denies accusations of official discrimination against Uighurs, and says all trials are carried out fairly and in accordance with the rule of law.

Rights groups have expressed concern about executions and mass-sentencings carried out regularly since an upswing in violence blamed on Xinjiang militants took place last year.

Another female attacker, Patigul Tohti, who was pregnant when she was arrested, received a life sentence, Xinhua said.