If you check the gallery below, then you can understand why the Hans are going crazy
Xinhua news agency said police restored order after demonstrators attacked passers-by and set fire to vehicles.
Xinhua did not say how many people were involved or what their motive was.
But activists and eyewitnesses said that those involved in the unrest were minority Muslim Uighurs. An overnight curfew has been declared.
Xinjiang is home to about eight million Uighurs, some of whom want independence.
"It started as a few hundred, and then there were easily over 1,000 involved," one unidentified eyewitness told Reuters news agency.
Adam Grode, an American national studying in Urumqi, said he has seen protesters knocking over police barriers and smashing bus windows.
Police responded with tear gas, hoses and batons, he told the Associated Press news agency, and once night fell more police and soldiers poured into the city.
Uighur activists in Japan and Germany said that they had received reports of multiple arrests.
Xinhua said that the three dead were Han Chinese.
It is not clear what triggered the unrest, but relations between the Han Chinese community and the Uighurs can be tense.
China enforces tight controls in Xinjiang and rejects calls from the Uighurs for self-rule.
In a report released earlier this year, it said that "severe cultural and religious repression" of ethnic minorities in Xinjiang had increased.
Uighur separatists, meanwhile, have waged a low-level campaign against Chinese rule for decades and there are sporadic outbreaks of violence.
Update: A letter from Baghdad: Memorable days in China as a Muslim