A teenager opened fire at a South Carolina primary school on Wednesday, wounding two students and a teacher before the suspect was taken into custody, a law enforcement officer said.

Anderson County Coroner Greg Shore told the Anderson Independent Mail that authorities were responding to a death "believed to be related" to the school shooting about one-and-a-half miles away.

Mr Shore also said the students do not appear to have life-threatening injuries.

The unidentified officer who spoke to reporters on live television said all other students at the Townville Elementary School were safe following the shooting and that parents are being told to pick up their children at a nearby church.

Television images showed officers swarming the school. Some were on top of the roof while others were walking around the building. Students were driven away on buses accompanied by police officers.

All of the roads to the school have been blocked off.

The school is in a rural area near Lake Hartwell, which is located near Interstate 85 and the Georgia state line.