The suspected shooter, a teenager, is in custody, deputy chief Taylor Jones said.
The father of the suspected shooter was found dead of a gunshot wound, Anderson County Coroner Greg Shore told reporters. Shore identified the man as Jeffrey Osborne, 47. The house is about 2 miles from the school.
Wednesday afternoon, the three victims at the school were struck by bullets from a handgun, Capt. Garland Major of the Anderson County Sheriff's Office said. One male student was hit in a leg and another boy was struck in a foot. The female teacher was wounded in a shoulder, Major said.
It is unclear whether the alleged shooter knew any of the school victims. Major said the motive is unclear, but terrorism has been ruled out.
The suspected gunman never entered the school, Anderson County Deputy Chief Keith Smith told reporters. The incident occurred at the school's playground, officials said.
An unarmed volunteer firefighter took the suspect down and held him until deputies showed up, Jones said.
The teacher and one student taken to AnMed Health Center were released Wednesday evening, hospital spokesman Ross Norton told CNN.
The other child was taken to Greenville Health System emergency trauma center by helicopter, spokeswoman Sandy Dees said. That student's condition was not known.
The mother of a student at Townville Elementary School told CNN Greenville affiliate WYFF that her daughter and classmates huddled in a bathroom.
"Her teacher was shaken up. I know all the kids were scared. There was a bunch of kids crying," the unidentified woman said. "She didn't talk for about five minutes when I got her. ... I'm just so scared. I don't even want her to go to school now."
The mother said she was praying for the families of the injured.
The shooting occurred about 1:45 p.m. ET, officials said.
Townville is in the extreme western part of the state, southwest of Greenville and near the Georgia line. Anderson County has a population of about 194,692. The elementary school has about 280 students. About 30 school employees are listed on the school's website.
School has been canceled for the rest of the week.
Joanne Avery, superintendent of Anderson County School District 4, told the media that school personnel have participated in active-shooter training and she said that training kept the incident from being much worse.
Gov. Nikki Haley said she would make sure law enforcement would have the resources it needed as investigators do their work.