A US Army trainee belonging to Fort Jackson in Columbia, South Carolina, was arrested after hijacking a school bus full of students.

According to Richland County Sheriff Leon Lott, none of the 18 children were injured after they and the bus driver were held hostage on Thursday by an individual later identified by Fort Jackson as 23-year-old Jovan Collazo from New Jersey, reports Xinhua news agency.

The incident lasted about an hour.

It all started when Collazo, dressed in a physical training uniform and armed with an M4 rifle, jumped a fence and left the military post at around 7 a.m.

Lott said the trainee initially tried to flag people down and get into cars, eventually ending up at a bus stop where the children were boarding a school bus that he also got on.

“He got on bus and told the bus driver he didn’t want to hurt him, but wanted him to take him to the next town,” Lott said.

He said the suspect drove a few miles and was “having difficulties operating the bus” before becoming frustrated and had the kids and the driver get off the bus.

Collazo then drove the bus a few miles before abandoning it, leaving in the bus what Fort Jackson confirmed was an issued rifle with no ammunition inside it.

Lott said Collazo then wandered through neighbourhoods trying to get “rice and clothes”.

Collazo, who Fort Jackson officials said was in his third week of basic training with his unit, was in the custody of Richland County Sheriff’s Department (RCSD) and charged with 19 counts of kidnapping, carjacking, possessing a weapon on school property, armed robbery and weapons possession during a violent crime.

Milford Beagle Jr., Fort Jackson’s commanding general, said during a news conference the suspect did not have access to ammunition, which is stored and monitored at a different site.

He said he believed that Collazo was likely trying to go home, and that the suspect brought his weapon along because leaving a weapon unattended is an indication someone is missing.

Beagle apologised for the “failure” on his side that led to the incident.

“To our community, this is something that was a failure with regard to me and my role in terms of our accountability procedures and processes,” he said, adding he will fix the security loopholes going forward, “because the outcome potentially could have been much worse”.

The RCSD is leading an investigation into the incident, with Fort Jackson having initiated its own probe.

Richland School District Two’s Superintendent Baron Davis said all of the children were offered counselling services when they arrived at Forest Lake Elementary School, and the district remained focused on addressing their social and emotional needs.

Fort Jackson is the US Army’s main production centre for basic combat training, according to its website.