The incident took place at Matthews Middle School on Darrell Road in Island Lake.
No one was injured and school let out as normal.
The student who apparently brought the loaded gun to school is in custody facing three felony charges.
The incident began to unfold when two students came to administrators and said they had heard or had seen the loaded gun.
Students at Matthews Middle School made it to first period and then stayed there for three hours. The school was on lockdown after a loaded handgun was found in the pocket of an eighth grader.
"It's incredibly scary," said parent Colleen O'Connor. "I never thought that would happen in a little town where we're from."
"The student did in fact have a loaded gun," said Supt. Daniel Coles, Wauconda School District 118. "The student was interviewed and taken into custody by the Island Lake Police Department."
During the lockdown, students put their coats and bags in the hallway to be searched by a police dog. Administrators also questioned students to determine if other threats existed.
"There was no threat or any other threat," said Island Lake Police Chief William McCorkle. "The school was on lockdown, per their policies. There was no threat to any other students. It was just that isolated incident."
Then the lockdown was lifted, but by that time, frantic parents heard that news and weren't getting answers.
"If you knew the media has this, somebody in your office could have taken 10 minutes and said something to us parents that our kids were OK," said one parent.
A recorded call went out to parents at 12:40 p.m. explaining the situation. Parents were allowed to pick up their children early.
"Unfortunately, the school didn't get a hold of anybody until after everything was over with, and we had already talked to our kids," said parent Anne Claver. "Luckily, they allowed the kids to call us, but it was pretty scary."
"I was upset that I heard it on TV," said parent Kim Crowder. "Knowing that your daughter's at the school, and not knowing what's going on ... that's very terrifying."
Superintendent Coles said he accepts criticism from parents who say they did not get enough information in a timely manner. He said his priority is keeping the kids safe, making sure the school is secure, and then getting out information. Getting out information prematurely can cause other problems, he added.