The trial for a middle-school student accused of pulling a gun on his teacher in front of his classmates in August and attempting to fire is set to begin Monday.

A jury will hear the case against 13-year-old Luke Andrews, who was charged with attempted murder, assault while displaying a dangerous weapon and carrying weapons on school grounds.

On Aug. 31, the Davenport boy, then 12 years old, brought a .22-caliber handgun into a classroom of North Scott Junior High in Eldridge, pointed the gun at other students and ordered everyone to the floor, according to a criminal complaint.

The safety was still on when the boy pulled the trigger, police said.

Police said the teacher, Dawn Spring, wrestled the gun from the boy. It was loaded with 11 rounds in the magazine and one round in the chamber. Andrews was taken into custody at school.

He pleaded not guilty to all charges in January.

If convicted of attempted murder, Andrews would be held in Iowa's juvenile justice system until he turns 18. The courts would then decide whether to transfer him to prison.

The jury could also choose to convict Andrews of lesser assault charges, instead of attempted murder.

The trial, set to be heard at the Scott County Courthouse in Davenport, is expected to last about five days.

Andrews' name was not initially made public because of his age. Scott County District Judge Patrick McElyea in January reversed his own ruling that barred the media from publishing Andrews' name and photograph. Andrews is being tried as a youthful offender in adult court.

MORE:Judge lifts order restricting media from publishing name of Iowa middle schooler accused of trying to shoot teacher

Andrews' father, Joseph Andrews III, was charged in August with control of a firearm by a felon the same day his son brought the gun to school. Authorities found guns in the elder Andrews' bedroom, court records show.

The father was convicted of three separate felonies in the 1980s, court records show.

Joseph Andrews III pleaded not guilty to the firearm charge in February, documents show. His jury trial is scheduled for Oct. 21.

Anna Spoerre is a breaking news reporter at the Des Moines Register. She can be reached by email at aspoerre@dmreg.com, by phone at 515-284-8387 or on Twitter at @annaspoerre.