(Reuters) - Four students were wounded on Monday after a shooting at a high school in southwest Ohio, and one suspect was in custody, according to officials.

Two students at Madison Jr/Sr High School in the city of Middletown were shot and taken to the hospital with nonlife-threatening injuries, school district and Butler County sheriff’s officials said.

Two more students were also hurt, possibly by shrapnel, law enforcement officials said.

Butler County Sheriff Richard Jones identified the shooter as 14-year-old James Austin Hancock. Hancock, who was a student at the school, ran away after the shooting. Officials said they have a motive for the shooting, but they declined to release it.

Hancock was being charged with two counts of attempted murder, two counts of felonious assault, inducing panic and making terroristic threats - all felony offenses.

The shooting victims - Cameron Smith, 15, and Cooper Caffery, 14 - were in stable condition, Jones said. Brant Murray, 15, and Katherine Doucette, 14, suffered minor injuries.

The shooting occurred about 11:30 a.m. local time, when Hancock entered the school cafeteria and began shooting, Jones said. Hancock then threw the gun away and ran off, but was later caught.

The gun appeared to be a .380 caliber semiautomatic handgun, Jones said.

The cafeteria had students inside and lunch trays were scattered everywhere, Jones said.

“All students are safe at this time,” the district said on its website and on Facebook. Local schools were placed on lockdown and students were dismissed early.

District officials said the school will be closed on Tuesday, as staff members make plans on moving forward, including offering on-site counseling.

Middletown, Ohio, is about 23 miles (37 km) southwest of Dayton and 38 miles north of Cincinnati.