BEIJING, May 29 (Reuters) - Chinese President Xi Jinping said on Thursday that China must strengthen education and work to alleviate poverty in the western region of Xinjiang, as the government works to weed out extremism in a region prone to unrest.

His remarks, made in a speech to Communist Party leaders, came after five suicide bombers attacked a vegetable market in Xinjiang's capital of Urumqi last week, killing 39 people and injuring 94 in the deadliest such incident in years.

Rights groups have long complained that the region's mostly Muslim Uighur people are cut off from economic development in the province because they face discrimination in hiring and other areas.

China heavily restricts religious worship in the region as well as the right to assembly, among other freedoms. Uighurs have long chafed at restrictions on their language and culture.

Communist Party leaders have vowed to crack down on religious extremists and separatist groups, which they have blamed for a series of violent attacks in Xinjiang and elsewhere in the country.

Xi said investment to the region must be increased to alleviate poverty, and that funding for education must be expanded. China would push forward bilingual education, he said.

"We must emphasize absorbing local labour and encourage Xinjiang people to work in the region," Xi said.

He added that "law-abiding" worshippers must be protected even as the party cracks down on extremists. Religious leaders' teachings must be grounded in patriotism.

Local officials in Xinjiang held a public rally in a stadium for the mass sentencing of 55 people on Wednesday, meting out at least three death sentences for crimes such as "violent terrorism".

Beijing says separatist groups in Xinjiang are seeking to form their own state called East Turkestan, though experts dispute the influence and reach of the most prominent group, the East Turkestan Islamic Movement.

Exiles and rights groups say Beijing's own repressive policies are to blame for fostering extremism. Uighurs have also long complained of official discrimination in favour of the ethnic Han majority. (Reporting By Megha Rajagopalan and Li Hui)