(CNN) A 10-year-old boy walking home from school in Philadelphia was critically injured Wednesday when he was shot in the back of the head by a stray bullet, according to police.

Philadelphia police said a man involved in the shooting has been arrested, but the gunman remains on the loose, CNN affiliate KYW reported.

Authorities said Semaj O'Branty was not the intended target, KYW reported. He was walking home from school in Frankford around 3:30 p.m. when police say a man driving a red Pontiac G6 fired at the man in custody, who tried to shield the boy and fired back, the station reported.

"He tries to cover the kid and protect the kid, but the kid takes a shot," Philadelphia Police Capt. John Walker said, according to the station.

Read More