The shooting took place at the end of the school day, around 3:30 p.m., at Wendell Phillips Academy High School, Chicago Police Detective Chief Brian Deenihan told a news conference.
The guard opened the school door and “immediately there was an offender on the street who started shooting in the direction of the security guard,” Deenihan said.
The guard was shot several times and bullets passed through an unopened door, hitting the teenager, Deenihan said. She was taken to hospital and was in critical condition on Tuesday.
The security guard, 45, was also taken to hospital and was in fair condition, police said.
Investigators do not know if the shooting was targeted. There were no arrests, police added.
The shooting comes after dozens of people were gunned down in the city over the weekend.
Forty people were shot dead in 31 shootings in Chicago over the holiday weekend, according to major incident notifications from the Chicago Police Department. Four victims were killed.