NISKAYUNA — Students and staff left Van Antwerp Middle School late Friday afternoon after a threat plunged the building into a nearly four-hour lockdown.

School officials called police to the campus at about 2:30 p.m. after someone found a note threatening violence in one of the school's bathrooms, the district said in a statement.

"Although the (police) department's investigation into today's situation is continuing, no credible threat was identified," principal Luke Rakoczy said.

The middle school locked down just before its typical 3:15 p.m. dismissal as police searched every classroom and hallway.

"We determined the entire school was safe," Niskayuna Deputy Police Chief Michael Stevens said at 6 p.m., speaking to the crowd of parents who had gathered outside the school during the lockdown.

Police called in dogs from other law enforcement agencies and searched every student and staff member in the building, because police did not know where the threat originated, Stevens said.

"I tell you that so everyone is aware of what happened with your children," the deputy chief told parents. He said the decision to search the students "came directly from me" and asked that parents with questions to call him Monday.

"This has been going on for three and a half hours," Stevens said. "The kids are tired. The kids are a little stressed out, as are all of the staff."

Students and staff were released one classroom at a time, police said.

Police and school officials decided not to release children to their waiting parents at the school house door, instead opting to load any students who typically take a bus home onto their usual bus and have parents meet them at their stop.

"We can see all of the traffic we have out here," Stevens said. "We have buses coming and we're afraid someone may get hit by a car. ... I understand you're going to have problems with that and I apologize now. But my goal is your children and to make sure your children get home safe. They've had a long day and we want to get them through this safely."

Students who walk or bike to school were dismissed once all buses were loaded.

Parents were not allowed to enter the building during the police search, so many gathered on the corner of Van Antwerp Road and Story Avenue. Sunita Persaud waited for news on her daughter Arianna, who is in the sixth grade.

"It's very terrifying," the mother said. "You never know what's going to happen. You see all these things on the news and you hope it doesn't happen to you."

Parsaud said her daughter leaves her cellphone in her locker, so she had no way of contacting the girl during the lockdown. News that a friend had been able to contact her son, who said he was OK, had helped, Persaud said.

School officials posted updates on the district website once an hour for the public. Parents said they received more frequent updates in emails, text messages and phone calls.

The school district administration, including the superintendent's office, is located inside the middle school.

"Our school counselors will be ready to talk with any student who needs assistance on Monday morning. We will be meeting as a whole school staff to talk about how we can open the week on a positive and supportive note, and to review our safety procedures," the principal said.