Bail was denied Saturday for an 18-year-old man charged with attempted murder in a shooting earlier this week outside a Back of the Yards neighborhood high school.

Andres Salazar, of Gage Park, was arrested Thursday and charged with attempted first-degree murder and aggravated battery with a firearm, according to Cook County prosecutors and Chicago police.

Judge Mary Marubio ordered him held without bail at his initial court hearing Saturday.

Shortly after classes were dismissed Wednesday afternoon, a 19-year-old man and two of his classmates noticed someone flash a black handgun from inside a car that was slowly circling the parking lot at Second Chance High School, 5114 S. Elizabeth St., authorities said.

The car then pulled up to the group and Salazar fired a single shot that struck the 19-year-old in his neck and jaw, prosecutors said. The man ran into the school for help and was rushed to the University of Chicago Medical Center in critical condition.

Prosecutors said he remained hospitalized and that the bullet may never be removed.

After the shooting, the man and his two classmates each identified Salazar in a photo array, prosecutors said. Additionally, surveillance footage obtained from the school showed Salazar’s car driving near the school at the time of the attack.

An assistant public defender assigned to Salazar said he attends a military academy and works at the former Rock N Roll McDonald’s at 600 N. Clark St.

His next hearing was set for Thursday.