TOWNVILLE, S.C. — A teenager killed his father at their home Wednesday before going to a nearby elementary school and opening fire with a handgun, wounding two students and a teacher, authorities said.

The teen was apprehended within minutes of the school shooting in this rural town about 110 miles northeast of Atlanta. One of the students was shot in the leg and the other in the foot, Capt. Garland Major with the Anderson County Sheriff’s Office said. Both students were male. The female teacher was hit in the shoulder.

Before the shooting at Townville Elementary about 1:45 p.m., the teen gunned down his 47-year-old father, Jeffrey Osborne, at their home about 2 miles from the school, authorities said.

“We are heartbroken about this senseless act of violence,” said Joanne Avery, superintendent of Anderson County School District 4. She canceled classes for the rest of the week.

The teen, crying and upset, called his grandmother’s cellphone at 1:44 p.m., Anderson County Coroner Greg Shore said. The grandparents couldn’t understand what was going on, so they went to his home just 100 yards away. When they got there, they found Osborne had been shot and their grandson was not there.