MONTREAL -- Provincial police say a man in the small eastern Quebec city of Sept-Îles seen roaming the streets Tuesday morning dressed in all black wearing a balaclava and possibly armed with a long weapon was actually holding a toy gun. 

A major police operation ensued after the man was spotted near a high school around 8 a.m., sending all of the nearby schools to go into lockdown. A photo of the man was shared on the Sûreté du Québec (SQ) Twitter page as the police force told residents to stay indoors and keep away from their windows. 

The man was located in a building on Régnault Street and then later taken into custody around noon after an hours-long commotion that even cancelled Quebec's health minister's press conference the same morning. 

Sgt. Hugues Beaulieu, a spokesperson for the SQ, told The Canadian Press that investigators couldn't initially tell from the photo shared online that the gun was not real and that police had to act "like it's functional."

"Obviously, we didn't take any chances. We were proactive. We cordoned off the area, we closed the school by barricading the students inside and we diverted the school bus traffic since it was the beginning of the school day at that time," Sgt. Beaulieu said.

The SQ said their investigation is ongoing. No charges have been laid. 

Health Minister Christian Dubé had been in Sept-Îles to make an announcement with Energy and Natural Resources Minister Jonatan Julien about a $159-million investment to modernize the local hospital. 

Earlier in the morning, the suspect was seen near Noël and Radisson avenues and police said he appeared to be armed with a silver barrel weapon and could be dangerous. 

Patrick Gwilliam, the director general of the municpality of Sept-Îles, told CTV News that many businesses in the area also locked their doors and were screening people at their entrances as a precaution. 

Students who had not yet arrived at school were told to stay home Tuesday morning and staff who were already at work were told to stay indoors. The head of the centre de service scolaire told CTV that kids in elementary schools were told not to leave during the lunch hour and that help will be made available to anyone who needs it after the "unprecedented" situation."

The City of Sept-Îles also issued a statement on its website notifying the public that doors to municipal buildings were closed to limit access. In a Facebook post at 12:07 p.m., the city said access to municipal buildings was open. 

- With files from The Canadian Press