Police confirmed they arrested 22-year-old Robert E Crimo III, who was from the area. They said he was driving a silver 2010 Honda Fit vehicle.
The shooting in the wealthy suburb of Highland Park on Monday caused toddlers to abandon tricycles and parents to run for safety with their children, turning a civic display of patriotism into a scene of panicked mayhem.
"It sounded like fireworks going off," said retired doctor Richard Kaufman, who was standing across the street from where the gunman opened fire, adding that he heard about 200 shots.
"It was pandemonium. A stampede. Babies were flying in the air. People were diving for cover. People were covered in blood tripping over each other.”
Police did not have a motive for the shooting.
More than 36 people were hurt, mostly by gunshots, said Jim Anthony, a spokesman for the NorthShore University HealthSystem.
The 26 victims taken to the Highland Park hospital ranged in age from eight to 85, said Brigham Temple, an emergency room doctor.
"We were all in shock,” his granddaughter Xochil Toledo said. "We thought it was part of the parade."
At least one of those killed was a Mexican national, a senior Mexican Foreign Ministry official said on Twitter.
The shooting comes with gun violence fresh on the minds of many Americans, after a massacre on May 24 this year killed 19 school children and two teachers at an elementary school in Uvalde, Texas, which followed a May 14 attack that killed 10 people at a grocery store in Buffalo, New York.
Children waving American flags, riding tricycles or enjoying a ride in a wagon pulled by adults froze as people in the crowd screamed while gun shots rang out, video on social media showed.
One cellphone video, seen but not verified by Reuters, recorded what sounded to be about 30 rapid shots, a pause, and then another roughly 30 shots. Between the two bursts, a woman can be heard saying from the side of the parade route: "My God, what happened?"
The Lake County Sheriff's Office posted an online wanted poster of Crimo, showing a thin-faced bearded man with facial and neck tattoos. It said he weighed 54kg and was 1.8 metres (5ft 11in) tall.
Crimo appears to have published several self-made rap songs using the artist stage name "Awake The Rapper."
A videos by Awake The Rapper shows a drawing of a stick figure holding a rifle in front of a another figure spread on the ground.
YouTube recently terminated an associated user account, after police named Crimo. The rap videos show a man looking like Crimo. A YouTube spokesperson did not immediately respond to a request for comment.
Police said the shooting took place from the rooftop of a business that the gunman reached via an alley ladder attached to the building that was not secure.
President Joe Biden said he and his wife Jill were "shocked by the senseless gun violence that has yet again brought grief to an American community on this Independence Day."
Biden said he had "surged federal law enforcement to assist in the urgent search for the shooter."
In his statement, Biden referred to bipartisan gun-reform legislation he signed recently but said much more needed to be done and added: "I’m not going to give up fighting the epidemic of gun violence."
Amarani Garcia, who was at the parade with her young daughter, told the local ABC affiliate she heard gunfire, then a pause for what she suspected was reloading, and then more shots.
There were "people screaming and running. It was just really traumatizing," Garcia said. "I was very terrified. I hid with my daughter actually in a little store. It just makes me feel like we're not safe anymore."
Social media video showed a marching band suddenly breaking formation and running away, and other images of people leaving their belongings behind as they sought safety.
"Everyone was running, hiding and screaming," said CBS 2 Digital Producer Elyssa Kaufman, who was at the scene.
A 36-year-old native of Highland Park who wanted to be identified only as Sara, told Reuters she had attended the annual parade most years since her childhood.
"Not even five minutes after, very shortly after, the police and firetrucks part of the parade had gone by I heard ‘pop, pop, pop, pop, pop,’" she said, adding that she first thought they were muskets some times used in parades.
"I looked and there were no muskets. The popping didn’t stop ... again it went ‘pop, pop, pop, pop, pop’ and I turned and I said ‘those are gun shots, run!’”
Highland Park's population is 30,000 and nearly 90% white, according to the US Census Bureau. About a third of the population is Jewish, according to the Jewish Telegraphic Agency.
The shooting is likely to rekindle the American debate about gun control, and whether stricter measure can prevent mass shootings that happen so frequently in the United States.
After the Uvalde and Buffalo shootings, Congress last month passed its first major federal gun reform in three decades, providing federal funding to states that administer "red flag" laws intended to remove guns from people deemed dangerous.
It does not ban sales of assault-style rifles or high-capacity magazines, but does take some steps on background checks by allowing access to information on significant crimes committed by juveniles.