CHICAGO (STMW) — A 14-year-old boy has been charged with attempted murder after turning himself into police Tuesday afternoon following the shooting of a 12-year-old boy outside a South Side elementary school.

The boy is charged as a juvenile with one count each of aggravated battery with a firearm and one attempted first-degree murder, police announced Wednesday evening.

READ MORE: Belmont Cragin Carjacking Leads To Fiery Crash, Multiple Other Parked Cars Struck

The teen turned himself in about 5 p.m. at the station, 7808 S. Halsted St., Gresham District police Capt. Juan Morado said.

The shooting stemmed from an argument that began on Facebook, witnesses and relatives of the 12-year-old victim told the Sun-Times.

But by 2:45 p.m. Tuesday, the alleged online threats became terrifyingly real when a 14-year-old gunman brazenly opened fire outside a South Side elementary school as hundreds of children were dismissed for the day.

Witnesses dived for cover as the teen-age gunman — wearing a brown Hollister brand hoodie — shot his 12-year-old gang rival in the back with a revolver outside Cook Elementary School in the 8100 block of South Bishop, witnesses say.

“We were coming out of the front door of the school when we saw him,” student Rashaya Williamson, 13, said, “Suddenly he started shooting and everyone was screaming and running.”

READ MORE: Dixmoor Boil Order Remains In Effect As Crews Continue Work To Identify Source Of Weeklong Water Woes

The victim was in stable condition Tuesday evening at Christ Hospital in Oak Lawn, police said. After he was shot, he ran back towards the school “but the door was locked and he couldn’t get in,” Williamson said.

Eventually somebody let him in as he cried in agony, while the teen gunman ran away southbound on Bishop, several witnesses said.

Police Cmdr. Eddie Johnson said detectives had spoken with many “really good witnesses,” and had a good idea of the suspect’s identity. He bemoaned the shooter’s “total disregard for human life.”

The victim’s relatives said the accused shooter was a former Cook student. He had fought with the victim previously, they said.

The threats the shooter made on the victim’s Facebook profile were deleted earlier Thursday, the victim’s family say, and they could not be confirmed by the Sun-Times, though the victim’s friends were already using his page to vow bloody revenge Tuesday evening.

MORE NEWS: 2 Killed, 14 Wounded In Weekend Shootings Across Chicago

One post on the victim’s Facebook said they would “ride back down” on the shooter and his friends.

© Sun-Times Media Wire Chicago Sun-Times 2011. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed