FAIRFIELD, Calif. — Fairfield police say their officers stopped what could have a deadly confrontation between students on Thursday.

Police had gone to a school within the Fairfield Suisun Unified School district after they were told a juvenile had a gun at school.

The district and police found the student but learned he didn't have a gun on campus.

READ ALSO: Suisun City man arrested after standoff at his estranged wife's home

However, a Fairfield officer learned that the student was heading to another high school campus after school to confront another student he previously had a fight with. 

Police officers James Lewis and Josh Bender stayed in the area when school got out and saw the student get into a gold sedan before leaving the area.

Officers did a traffic stop on the car based on the illegal window tint on the front windows and found five juveniles and one adult in the car. The student was in the backseat with three other juveniles.

During a search of the car, police said they found an illegally possessed gun under the driver's seat. Police described it as a replica Glock semi-automatic handgun with no serial number and a loaded magazine.

The driver was cited and released at the scene for contributing to a minor, and two teenage boys, 16 and 17 years old, were arrested on several weapon violation charges and booked into Solano County Juvenile Hall.

Police say the work of Officers Lewis and Bender prevented a potentially deadly situation.

READ ALSO: Fairfield man tried to run officer over with car, police say | Update

WATCH ALSO: 

Inside the Sacramento Police Academy | The Recruits