An armed offender has opened fire at a US middle school, injuring an adult and a child before a suspect was taken into custody, authorities said.

The victims in the attack at Noblesville West Middle School, in suburban Indianapolis, were taken to hospital in Indianapolis and their families were notified, said Bryant Orem, a spokesman for Hamilton County Sheriff’s Office.

The suspect is believed to have acted alone and was taken into custody, he said.

Indiana University Health spokeswoman Danielle Sirilla said an adult victim was taken to IU Health Methodist Hospital and a child was taken to Riley Hospital for Children.

She had no information on the victims’ ages or the seriousness of their injuries.

Helicopter footage showed dozens of police officers milling around the school. Students were bused to Noblesville High School gym, where their families could retrieve them.

Noblesville, about 20 miles north east of Indianapolis, is home to about 50,000 people. The middle school has about 1,300 students from grades 6 to 8.

The attack comes a week after an attack at a high school in Santa Fe, Texas, that killed eight students and two teachers.

Governor Eric Holcomb issued a statement saying he and other state leaders were getting updates about the situation and that 100 state police had been made available to work with local officers.

“Our thoughts are with all those affected by this horrible situation,” Mr Holcomb said.

Among the worried parents who rushed to get their children was Erica Higgins, who told WTHR-TV she learned of the shooting from a relative who called her at home.

“I just want to get my arms around my boy,” she said.

Ms Higgins said her son was shaken up but knew little about what happened.

“I got a ‘Mom, I’m scared’ text message and other than that, it was ‘come get me at the high school’,” she said.