A scuffle then broke out as nearby students watched the incident unfold.
"Other children joined these two in struggling with him, throwing stones in an effort to chase him away, and ultimately they were successful," Darby said.
Ferguson fled the scene, and police began a manhunt for him after his would-be victims told school personnel about the attack, Darby said.
After pressure from a "heavy police presence" in the area, Ferguson turned himself in to SVU detectives late Tuesday with a gash above his right eye from his encounter with the rock-wielding kids, according to Darby.
Ferguson remained in custody last night, with his bail set at $500,000, according to court records.
"His behavior is bold, and it's definitely threatening and creates a threat to that community," Darby said.
Police are looking for links to Ferguson in a similar incident near the school Feb. 19, in which a man matching his description attempted to abduct a 10-year-old girl, Darby said.
Court records show the North Philadelphia man has prior convictions for corrupting a minor and resisting arrest, and pleaded guilty to indecent assault in 2007.
On Twitter: @Vellastrations