A man is facing charges after he allegedly pulled out a knife inside a downtown library on Monday afternoon.

The incident, which was captured on video, occurred around 2:15 p.m. on the ground floor of the Toronto Reference Library.

A man who said he witnessed the event told CTV News Toronto that the man was drinking from a vodka bottle inside the library prior to the incident.

“Security warned him and he was being obnoxious,” said Oliver, who only wanted to be identified by his first name. “It got to the point where security had to call the police.”

An officer who was nearby responded to the call, and that’s when Oliver said the man pulled out the knife. The officer then called for backup.

“He did not go by what the police said or anything like that. It just escalated to the point where he kept on coming up to the officer.”

In video of the incident posted to YouTube, officers can be seen approaching the man, who appears to pull out a sharp object. Officers can be seen urging patrons to leave the area while the man moves around the tables.

The video shows the officers approaching the man as he asks police to shoot him.

“I don’t want to hurt you,” the officer is heard saying in the video.

After the man yells “shoot me,” an officer is then seen in the video firing a Taser, which is pointed at the man. When the man steps back, but does not drop the knife, the sergeant fires a second time. The man falls to the ground.

Police said that the man was transported to the hospital and treated for minor injuries. He has been charged with threatening bodily harm and weapons dangerous.

He appeared in court on Tuesday.

The President of the Toronto Police Association commented about the incident on social media, commending the officers for their “great work.”

“Officers were able to defuse a potentially deadly situation and safely take a suspect into custody,” Mike McCormack said on Twitter.

With files from CTV News Toronto's Sean Leathong