EDMONTON -- All students have been cleared to leave an Edmonton elementary school that was put under a hold-and-secure order Friday afternoon after a man barricaded himself in a nearby building. 

Students were at first held for several hours past the school day's end, then evacuated Friday evening from Lymburn School on 72 Avenue NW due to the incident.

Police asked motorists and pedestrians to avoid the area while they dealt with "a barricaded male suspect at a nearby residence."

They were called to the home at around 3 p.m. for reports that a man attacked two other men with a knife.

The two other men exited the home and have since been treated in hospital for non-life threatening injuries.

About 300 students plus staff were held inside the building until about 6 p.m., until police determined an evacuation plan. Students whose parents were at Lymburn School were evacuated in phases, while those without guardians there were being kept inside the building. 

Eventually all students were cleared to leave, Edmonton Public School Board said. 

The incident was resolved peacefully at 2 a.m. Saturday when the man surrendered, according to police.

Charges are pending.