A 16-year-old girl used a stolen machete and knife to hack an Uber driver to death in an unprovoked attack earlier this week in north suburban Lincolnwood, Cook County prosecutors said Wednesday.

“This is a random act of violence,” Judge Michael J. Hood said before denying Eliza Wasni bail during her bond hearing at the Skokie Courthouse.

Wasni has been charged as an adult with first-degree murder in 34-year-old Grant Nelson’s slaying.

The Taft High School student, barely taller than 5 feet with bleached blonde hair, was expressionless at Wednesday afternoon’s hearing, wearing an oversized white jumpsuit and a blue sweater.

Eliza Wasni | Facebook

The day before at 1:25 a.m., the first of three ride-hailing drivers that Wasni encountered early Tuesday morning picked her up and took her to a train station in Des Plaines, Assistant State’s Attorney Michelle Cunningham said.

About an hour later, another Uber driver picked Wasni up and took her to a Wal-Mart store near McCormick Boulevard and Touhy Avenue in Skokie, where she grabbed a knife and machete, unwrapped the weapons and walked out without paying, Cunningham said. No employees tried to stop her.

At 3:18 a.m., a few blocks west of the store, Nelson picked Wasni up in his Hyundai Sonata while driving for Uber, Cunningham said.

Within two minutes, the teen began hacking at Nelson as the car approached the intersection of Touhy and Lincoln avenues, stabbing him repeatedly on the right side of his arm, torso, head and chest, Cunningham said.

Nelson pulled up to a condo building in the 7200 block of Touhy, ran to the building lobby and slammed on the door screaming for help, Cunningham said.

Responding Lincolnwood police officers followed a trail of blood and found him on the grass on the side of the building.

Wasni took the wheel of Nelson’s car and drove back toward Lincoln and Touhy, where the car hit a median, Cunningham said. Officers found Nelson’s phone in the front seat and saw that Wasni was listed as his Uber passenger, Cunningham said.

Grant Nelson | Facebook

Soon after, an officer spotted the girl hiding behind an office building a few blocks north of the crash scene, Cunningham said. She had taken off her blood-spattered, long-sleeve Cubs T-shirt but was still holding the bloody knife and machete, Cunningham said.

Officers repeatedly told her to drop the weapons but “she didn’t acknowledge them,” Cunningham said. One officer shocked her with a stun gun and she was arrested.

Nelson, a Wilmette resident, told police his passenger had stabbed him, Cunningham said. He died at St. Francis Hospital in Evanston later that morning.

During a press conference after Wednesday’s court hearing, prosecutors declined to comment on a possible motive for the killing.

Police said Wasni wouldn’t talk to detectives.

Wasni, who has no previous criminal record, goes to school at Taft on the city’s Northwest Side and lives with her single mother, Assistant Public Defender David McMahon told the judge.

About a dozen family members and friends of Nelson attended the bond hearing.

“The details were horrifying and saddening,” his sister Alexandra Nelson said afterward. “The loss of intelligence and conversation and nuance and thoughtfulness that he brought into all of our lives is going to be felt, and it will reverberate with us throughout the coming weeks and months and years, and it’s not a hole that can be easily filled,” she said.

Melissa Smetana said she used to work with Nelson at a restaurant in Northbrook and described him as a hard-working, generous friend.

“He was the type to give you the shirt off his back,” Smetana said. “If the girl had asked him for something, anything, Grant would have given it to her. It’s senseless.”

Friends have set up a GoFundMe campaign to raise money for the National Alliance on Mental Illness and the Anti-Cruelty Society in Nelson’s honor.

In a statement, an Uber spokeswoman said the company was “heartbroken by the loss of one of our partners, Grant Nelson. Our deepest sympathies and prayers are with his family and loved ones during this incredibly difficult time.”

Nelson’s fatal stabbing was the first homicide in Lincolnwood since 2006, when a murder resulted from an argument between two brothers. In that case, James B. McDurmon was convicted for the the murder of his brother, Lester McDurmon, and was sentenced to 60 years in prison.

Contributing: Jeff Mayes and Nader Issa