A southwest high school was locked down for around four hours Friday afternoon.

Police were called to Bishop Carroll High School around 1:30 p.m. after receiving reports that three non-students had entered the school. One was believed to be carrying a gun.

Students and staff were locked into classroom and eventually moved to the school gymnasium to wait for police to search the school.

Over 30 officers and several Canine Unit members were called in to help with the response.

At around 5:30 p.m. students were allowed to leave.

Investigators say one the female students at the school told the principal she had received a threatening call from her ex-boyfriend.

One of the girl's friends then reported seeing the boyfriend with a few of his friends inside the school.

Police immediately flooded the area with a massive response.

Teams of officers patrolled the school, searching every room until the all-clear was given.

Students were also patted down in case a weapon was being concealed. Two students were briefly taken into custody before being released. Police initially believed they may have been friends of one of the suspects but it turned out to be a case of mistaken identity.

Police say the lockdown was one of the largest in Calgary history with five hundred students scattered throughout the five-storey building.

Staff at a nearby daycare and community centre also locked themselves down for several hours during the investigation.