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 the 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 shooter never entered the school building and was apprehended by firefighter Jamie Brock, a 30-year veteran of the Townville Volunteer Fire Department, according to Anderson County sheriff’s Lt. Sheila Cole.

Authorities did not reveal the teen’s age at a news conference Wednesday afternoon, and Cole says she doesn’t have his age. The Anderson Independent-Mail quotes Anderson County Sheriff Chief Deputy Keith Smith as saying the teen is 14 and could be charged as a minor.

Authorities did not release a motive for the shooting and said they weren’t sure if the students and teacher were targeted.

One of the students and the teacher were released from the hospital Wednesday evening, AnMed Health spokeswoman Juana Slade said. Greenville News earlier reported that a 6-year-old was airlifted to Greenville Memorial in critical condition. Greenville Memorial spokeswoman Sandy Dees confirmed that a child was taken to the hospital but would not release any further information.

Asked about the teen’s relationship to the students, Major said “I know they all go to school together.” He later said the teen was being homeschooled and didn’t clarify his earlier remark.

Authorities said they believe there was only one shooter and that all other students at Townville Elementary were safe. The students were bused to a nearby church and reunited with their parents. They hugged and kissed.

The school has about 300 students in its pre-kindergarten to sixth-grade classrooms. It is in a very rural part of the state and surrounded by working farms.

“This is the country,” Brandi Pierce, the mother of a sixth-grader, told the Associated Press as she began to cry. “You don’t have this in the country. It just don’t exist out here.”.

Gov. Nikki Haley released a statement shortly after the shooting.

“As we work together with law enforcement to make sure they have the support they need to investigate what happened in Townville, Michael and I ask that everyone across South Carolina join us in praying for the entire Townville Elementary School family and those touched by today’s tragedy.”