A 16-year-old girl stole a machete and a knife from a Walmart before climbing into an Uber car and hacking into the driver who later died, a Chicago court has heard.
The driver died of his wounds after giving police a description of the attacker, leading to her arrest.
A prosecutor read out an account of the attack, saying Eliza Wasni climbed into a car driven by 34-year-old Grant Nelson and attacked him with the knife and machete.
The judge ordered the girl, who was charged as an adult with first-degree murder, to be held without bond.
The two-page description offered no reason for the attack, but portrayed Wasni as a calm girl who "nonchalantly" could be seen walking through Walmart, the knives in hand, before she walked outside without paying.
Assistant public defender David McMahon said Wasni had no previous criminal record, attended high school and lived with her mother.
Prosecutors said Nelson, a resident of Wilmette in Illinois, picked the girl up shortly after 3am on Tuesday (local time).
It was her third ride in an Uber vehicle in the early morning hours of Tuesday.
Two minutes after he began driving, prosecutors said Wasni began stabbing Nelson from the back seat.
Nelson was able to pull over and ran into a nearby condominium building, where he screamed, "Help me, help me! I'm going to die!" until residents called emergency services.
Wasni climbed into the front seat of Nelson's blood-splattered silver sedan and drove away, striking a median strip in the road.
She jumped out of the vehicle and fled on foot.
When police arrived, they found the vehicle with blood on both the inside and the outside, with Nelson's phone open to the Uber app.
The app said Nelson's passenger was someone named Eliza.
Officers followed the trial of blood and found Nelson lying in grass.
He was bleeding profusely from several wounds, and was able to tell the officers what had happened. He died at a nearby hospital a few hours later.
Using the description given by Nelson, police found Wasni nearby crouching behind an air conditioner with a machete in one hand and a knife in the other.
Police warned her that she would be shot with a Taser if she did not drop the weapons, and when she did not comply an officer used the Taser.
Wasni dropped the knives and was taken into custody. Police said she did not make a statement.
According to prosecutors, police recovered a shirt the girl could be seen wearing in the Walmart. The shirt had blood on it.
Uber officials said the company was working with police to provide information relevant to the investigation.
We are heartbroken by the loss of one of our partners, Uber said in a statement.
Our deepest sympathies and prayers are with his family and loved ones during this incredibly difficult time.
Nelson's sister, Alex Nelson, told local media her brother was a good person.
He was not a vindictive person, Alex Nelson said.
He was not a cruel person. He didn't deserve this fate.