A police officer stands near the entrance to the combined Rockport Middle and High School after a middle school student allegedly stabbed another student earlier in the day on Monday in Rockport, Massachusetts. Credit: Paul Bilodeau | The Eagle-Tribune via AP

ROCKPORT, Massachusetts — A 13-year-old boy stabbed a girl at a Massachusetts middle school before the start of classes on Monday, inflicting injuries considered serious but not life-threatening, police said.

A school resource officer was on the scene at Rockport Middle School almost immediately after the 7:30 a.m. assault, Rockport police Chief John Horvath said in a statement.

The suspect had already fled but was located outside the school and arrested, he said.

The girl, whose age was not disclosed, was taken to the hospital.

No names were made public because of their ages, but both were students at the school, the chief said. He did not disclose a motive.

The suspect faces arraignment in juvenile court. Horvath did not say exactly what charges the boy faced.

The school was locked down during the search for the suspect, but the lockdown was lifted at 9 a.m. and the school day continued with an additional police presence at the scene.

There was no danger to the school or the community, Horvath said.

Schools Superintendent Robert Liebow said in a statement that parents would be allowed to take their children home early if they wanted.

The coastal town of about 7,000 residents is about 40 miles north of Boston.