The 19-year-old man charged with attempted murder in the shooting of two young girls attending an end-of-year school picnic had flashed gang signs before gunfire erupted from the Jeep he was riding in, a prosecutor said Sunday.

Raekwon Hudson, wearing a torn and tattered green sweatshirt, showed little reaction when Cook County Judge Peggy Chiampas ordered him to remain in jail.

“No bail! Take him back!” Chiampas shouted to her courtroom sheriff’s deputies after voicing her disgust.

“Young children in this city can’t participate in a picnic without being in fear of their lives because of gangbangers on the street with guns,” she said.

The intended targets of the shooting were three students who showed up Friday afternoon to the picnic outside Warren Elementary School, in the 9200 block of South Jeffery, Cook County Assistant State’s Attorney Andrew Yassan said.

The trio were denied access by a security guard because they had not been allowed to participate in the school’s graduation ceremony for disciplinary reasons, Yassan said.

The three lingered outside the school until one of them saw someone in a dark-colored Jeep flash a gun, prompting the group to ask the security guard if they could cut through the school building. The guard denied the request and the three students began walking away from the school.

They didn’t make it far before the Jeep returned.

“The three targets were identified by one of the occupants of the car as ‘ops,’ meaning members of an opposition gang,” Yassan said.

The three fled into the playground of the school as gunfire erupted from the back seat passenger side window of the Jeep.

Children attending the picnic, some of whom were making water balloons, scattered, but two innocent girls were wounded. A 7-year-old girl was shot in her right thigh and suffered graze wounds to the pinkie and index fingers on her right hand.

A bullet went through the right hand of another girl, 13, fracturing her ring finger, a wound that may require surgery, Yassan said.

A security camera from a nearby residence captured video of the shooting and one of the witnesses identified Hudson as the front seat passenger, Yassan said.

Police recovered 11 bullet casings from the street spread in a manner consistent with being shot from a moving vehicle, Yassan said.

Minutes after the shooting, police on patrol a few blocks away saw the Jeep in a garage as the garage door began to close. Hudson and two teens he was with ran, but didn’t get far.

Police arrested the three and found the keys to the Jeep, which had been reported stolen hours earlier, on Hudson.

At a hearing Sunday, Cook County Judge Stuart Katz ordered both juveniles to remain in custody, according to a spokeswoman for Cook County State’s Attorney Kim Foxx.

The juveniles — ages 16 and 17 — received the same charge as Hudson: two counts of attempted first-degree murder and two counts of aggravated battery discharge firearm.