ZHARKENT, Kazakhstan -- A court in Kazakhstan has convicted ethnic Kazakh Chinese citizen Sairagul Sauytbay of illegal border crossing, but ordered her release and said she will not be deported to China, where she feared she would face "the most extreme" punishment.

Joyful relatives, friends, and rights activists in the courtroom greeted the August 1 ruling with a cheer and Sauytbay was reunited with her husband and two children when she walked out of the glass cage for defendants.

Sauytbauy fled China in April and has testified at her trial in Kazakhstan that thousands of ethnic Kazakhs and other Muslims are undergoing "political indoctrination" at a network of "reeducation camps" in western China.

At the trial in Zharkent, outside Almaty and close to the Chinese border, Judge Dinara Quiqabaeva sentenced Sauytbay to six months of parole, ruling that the sentence was suspended due to the "exceptional circumstances of the case."

WATCH: Ethnic Kazakh 'Grateful' Not To Be Deported To China

"Taking into account the fact that the defendant had to commit the crime because it was the only way for her to reunite with her family, the crime cannot be considered serious," the judge said.

When a smiling Sauytbay left the courthouse with her family, surrounded by her supporters, dozens of people greeted her outside chanting, "Long live Kazakhstan!" and "Sairagul is our hero!"

Sauytbay thanked everyone who came to her trial and has been supporting her during her ordeal.

"When I came to Kazakhstan, I had a feeling that I am on my own. Now I am confident that it is not true," she said. "I have my people, my nation, my homeland that can stand for me! Thank you! Long live Kazakhstan!"

Sauytbay's husband and two children have been living in Kazakhstan for several years and obtained Kazakh citizenship last year.

Sauytbay, a 41-year-old native of the Ili-Kazakh Autonomous Prefecture in China's northwestern Xinjiang Uyghur Autonomous Region, was not allowed to leave China as she had the status of a state official there.

Before crossing into Kazakhstan on April 5, Sauytbay had been the head administrator of a kindergarten -- a position that, together with her membership in the Communist Party, technically made her a Chinese state official.

She was arrested in May at the request of the Chinese authorities, and Chinese diplomats have attended her trial.

In trial testimony, she said Chinese authorities had forced her to train "political ideology" instructors for reeducation camps in western China's Xinjiang Uyghur Autonomous Region.

That, she said, gave her access to secret documents about what she called a Chinese state program to "reeducate" Muslims from Xinjiang's indigenous ethnic minority communities -- mainly Uyghurs, ethnic Kazakhs, ethnic Kyrgyz, and Hui.

She says she also witnessed the inner workings of the program while employed at a camp for ethnic Kazakhs in the region's Mongol-Kuro district.