The riots that led to some of China's worst ethnic violence and set the wheels in motion for today's internment camps in Xinjiang began in the most unlikely of places: a toy factory.

Key points: Tensions between Uyghur Muslims and Han Chinese people has simmered for decades

Tensions between Uyghur Muslims and Han Chinese people has simmered for decades The Urumqi riots of 2009 marked a turning point in Xinjiang, which has become a surveillance state

The Urumqi riots of 2009 marked a turning point in Xinjiang, which has become a surveillance state There are reports of more than 1 million Uyghurs are being detained in re-education camps

July 5 marks the 10th anniversary of the Urumqi riots, which pitted Uyghur Muslims against Han Chinese on the streets of Xinjiang's capital.

The Uyghurs, a Turkic-speaking minority from Central Asia, are a distinct ethnic group from Han Chinese, with Urumqi being closer to Kabul than Beijing.

The riots started out as a peaceful protest but descended into looting, beatings and killings of Chinese people, with deaths occurring on both sides.

What unfolded a decade ago has had long-lasting consequences, with reports of more than 1 million Uyghur Muslims being detained in re-education camps and Xinjiang transforming into a surveillance state.

What happened on July 5?

Uyghur protesters clashed with Han Chinese people in July 2009 during outbreaks of deadly ethnic violence. ( Reuters: Nir Elias )

In late June 2009, a disgruntled worker posted a rumour online that a Han Chinese woman had been sexually assaulted by Uyghur migrant workers in a toy factory in Shaoguan, in China's south-east.

In response, some Chinese workers cornered and beat Uyghurs in the factory, killing at least two of them.

Footage of the attacks spread swiftly online and, almost 4,000 kilometres away in the north-western region of Xinjiang, ethnic tensions reached boiling point.

Uyghur students staged a demonstration in Urumqi, where some claim police fired live ammunition on protesters, sparking the riots.

Chinese authorities reported that 197 people — the majority of them Han Chinese — were killed in the resulting violence and 1,700 people were injured.

In the following days, mobs of Han Chinese people took to the streets with sticks and metal bars, meting out revenge in attacks on Uyghurs.

It was the deadliest unrest in decades, but the figures are hotly disputed — some Uyghurs in exile suggesting thousands may have been killed in the reprisals.

The Chinese Embassy in Australia said the July 5 incident was a "serious and violent crime" that had partly been "plotted and incited" by outside forces and resulted in the loss of innocent lives.

The embassy said after the incident authorities "took decisive measures in accordance with law to ease the tension, protect local people's safety and property, and maintain social stability".

Haunting scenes remembered a decade on

A Han Chinese man was one of more than 1,000 people injured in ethnic clashes in Urumqi in 2009. ( Reuters: David Gray )

London-based poet and researcher Aziz Isa Elkun was bathing his two small children when he heard a loud noise and peered out the window.

"I saw smoke rising from fire. Live gunshots, screaming," he said.

The following day, he saw people using water to wash the blood from the street near Xinjiang university.

Alip Erkin, who runs the Uyghur Bulletin from Australia, remembered his niece running home past corpses.

A Uyghur man touches his son's injured chest after he was beaten during ethnic clashes in Urumqi in 2009. ( Reuters: David Gray )

One Uyghur asylum seeker in Australia, who asked to be known simply as Abu for fear of reprisals against his family members still in Xinjiang, recalled eerie scenes of an overturned car and seeing lifeless bodies on the street.

He saw a Uyghur man die from a bullet wound and remembers an older woman draping him in a white funerary shroud that she had prepared for herself.

"Until that time, I was in disbelief. But I saw [it with] my own eyes," Abu said.

Later, he watched police enter his neighbourhood and round up dozens of Uyghur men, pulling their shirts over their heads and tying their hands behind their backs with belts.

Long-simmering tensions

Uyghur Muslims in Xinjiang are heavily monitored by the Chinese Government. ( Reuters )

The Urumqi riots marked a turning point for the Uyghurs, but ethnic tensions had been simmering for decades, if not centuries.

For more than 200 years, Uyghurs and Chinese have been locked in political turmoil, with Uyghurs fighting to maintain control as China expanded westward.

Uyghurs briefly declared the East Turkestan Republic in 1933 and again 1944 — enjoying fleeting moments of independence.

But the area was brought under complete communist control in 1949 — when the People's Republic of China was established — and later renamed the Xinjiang Uyghur Autonomous Region.

Despite the name, it is tightly controlled by Beijing.

During Chairman Mao Zedong's Cultural Revolution of the 1960s and 1970s, religion was banned under communism — mosques were razed and copies of the Quran were destroyed.

Recent decades have been marked by separatist violence and Government crackdowns, with a shift in the ethnic make-up of Xinjiang compounding tensions.

State-sponsored migration saw the Han Chinese population there swell from less than 7 per cent in 1949 to 40 per cent now, while the Uyghur population dropped from 75 per cent to about 45 per cent.

Past violence used to justify mass camps

Riot police clashed with members of the Uyghur Muslim population in Xinjiang in the capital Urumqi. ( AFP: Peter Parks )

The riots, and the subsequent reprisals, catapulted the situation in Xinjiang onto the global stage.

It was distinct in the unprecedented role the internet played in fuelling the violence with the rapid spread of information and has been used as a justification for a shift in China's treatment of ethnic minorities, according to La Trobe University's James Leibold.

"A lot of those people calling for a change in ethnic policy saw the Urumqi riots as a kind of turning point," he said.

"Examples of instability are used as a way to kind of demonstrate what I call an 'accommodationist' or practical set of policies had failed."

A chain of factors formed the dry tinder that sparked the horrific violence, Dr Leibold said, including the economic marginalisation of Uyghurs, the erosion of their language and the slipping away of their autonomy.

In the past, China has vehemently denied that Uyghurs are unfairly marginalised, but it rings true in Abu's experience.

Abu said ethnic policy in Xinjiang had been a "total failure", and said while he could not defend the actions of Uyghurs who beat Han Chinese, he said the violence was seen as "inevitable".

"I can't just mix my Uyghur identity to this issue, saying Uyghurs didn't commit crimes — they did commit crime there at that time," he said.

"But we were isolated from China basically … jobs had been taken away and we were discriminated against.

"Eventually you will have some resistance, even if it seems as though you have control of the entire society."

Turning up the heat on ethnic assimilation

A mass stabbing attack at Kunming railway station in 2014 was dubbed "China's 9/11" by state-run media. ( Reuters )

Urumqi "demonstrated to many Han Chinese officials that a new approach was needed —that they needed to turn up the flames on ethnic assimilation, that they needed to push harder on bilingual education, push harder on securitising and surveilling ethnic communities," Dr Leibold said.

China's anti-terror measures were cemented after bursts of further violence, notably in 2012 and in 2014, when Uyghur separatists executed a series of bomb blasts in Xinjiang, and dozens were killed when Muslim extremists went on a stabbing rampage at a train station in Kunming.

In the era of President Xi Jinping, China's approach has taken a more assimilative turn, with the most coercive aspect being Xinjiang's re-education camps, Dr Leibold said.

"We've seen the autonomous spaces in China rapidly disappear, as the state inserts themselves and their eyes and ears into the private lives of Chinese citizens, whether they be minority or Han," he said.

China has dismissed accusations of mass internment of Muslims as "gossip", and said its "vocational training centres" are necessary to combat "rampant terrorism".

"To bring the situation under control, continuous efforts have been made to eradicate extremism, resolutely ban illegal religion teaching and learning activities, and remove the breeding ground that allowed religious extremism to grow and spread," the embassy in Australia said in a statement.

It compared the centres to "boarding schools" that had worked in preventing violent attacks, and it denied Uyghurs' freedoms were restricted.

"The vocational education centres in Xinjiang are not concentration or re-education camps as portrayed in some media reports," the statement read.

"One day, the centres won't even be there, when there is no need for them anymore."

But evidence of increased surveillance can be seen from space and has taken on a more technological bent, moving from police-prepared dossiers to installing facial recognition cameras in mosques and on the streets of Xinjiang.

A Guardian investigation this week found that Chinese border police were also secretly installing surveillance apps on the phones of tourists crossing into Xinjiang in order to download personal information and private emails, texts and contacts.

Today, the BBC reported China is using schools to deliberately separate Uyghur children from their parents and their cultural roots.

'They will be sent to the camps'

A community notice board displays photos of missing Uyghur family members in China. ( ABC News: Joshua Boscaini )

Mr Elkun said it took his young family more than a year "to recover from this nightmare" after the events of July 5.

But it didn't end there. In the years since, he said: "I lost all my family connections, all my friends … we feel as though we have lost everything."

The Urumqi riots and its aftermath were a personal turning point for Abu too, who said discrimination intensified after 2009.

Living abroad, he is mostly cut off from his father and two sisters who still live in Xinjiang.

"I want to contact them, but I can't. If I do that, they'll be sent to the camps," he said.

In May last year, he received a message from his sister on WeChat. It said: "They are taking me".

Almost a year later, in April this year, he received a video call from his sister. He thinks she was speaking from a police station.

She told him they had been released but this was the last time they could speak.

"They didn't blame me," he said.

"Even though they have been detained just because of me, for almost a year. They didn't blame me."