DeFOREST, Wis. -

The arrest of a Sun Prairie student for a social media threat and a weapons violation is connected to a lockdown at another school, officials said.

Sun Prairie police said a student posted a picture of a handgun and a threatening statement on social media.

Police and school officials removed the student from class and found a handgun and ammunition in a backpack, according to a release.

Sun Prairie police said Sun Prairie High School did not go into lockdown because the situation happened so quickly, and officers were able to get the student out of class and into a secure room before searching his backpack.

Authorities said the DeForest High school was locked down at about 2:15 p.m. The lockdown was lifted about 45 minutes later.

The DeForest Area School District said the school was investigating a reported threat at the high school and police were at the school to determine if the threat was credible. Police received the information via social media, according to a news release.

Sun Prairie police said DeForest High School went on lockdown because the student used to go to DeForest High School and DeForest police learned about the threat on social media first.

DASD and police officials said other schools in the district were also locked down as a precaution.

DeForest police said it was an unverified threat of a student possibly armed with a handgun. After lockdown, police determined that the student was not in the building but in a neighboring community. The student and the student was taken into custody without incident, police said.

Parents were asked not to come to the school until police had assessed the situation. DASD said the lockdown was lifted at 3 p.m. The school said students would remain in their classrooms until the end of the day Thursday and bus transportation would pick up as normal, the school said. After-school activities Thursday would resume as scheduled, officials said.

DASD said in a statement on its website that the threat "was determined not to pertain to our high school or our district."

Sun Prairie police said the arrest at Sun Prairie High School and the lockdown at Deforest High School were connected, but did not release any additional information.

Sun Prairie district officials said they sent a detailed email to parents explaining the incident.

Sun Prairie police said the student was taken into custody, and a criminal investigation is in progress. Officials do not yet know if the student had intention to use the gun and ammunition.

Officials ask anyone with information on the incident to call 608-837-7336.