A security guard working at the San Francisco Public Library was hospitalized with serious injuries after he was viciously attacked by a visitor’s pit bull inside the building. The horrific attack was captured on camera.

The incident happened Sunday evening. People noticed a dog continuously barking next to its owner "who was seemingly unresponsive at a computer kiosk," the public library said in a statement, SF Gate reported.

Upon noticing the unresponsive man, two security guards approached him to help. However, the pit bull, believed to be a service animal, started "exhibiting aggressive behavior" and did not let them near its owner. Soon, the 9-year-old canine attacked one of the guards, pushing him to the floor as his colleague attempted to rescue him.

A video of the incident, captured by a library patron, went viral on social media.

Throughout the incident, the owner of the dog was "largely unresponsive" until another visitor eventually woke him.

"Once alert, he was able to get control of the dog, who he claimed was a service animal. The patron was uncooperative and argumentative with staff following the incident," the library said in a statement.

Once the pit bull, named Dorje, let go of the guard, he was rushed to a local hospital with serious injuries. He remained in the hospital as of Tuesday.

Meanwhile, the animal control removed the pit bull and brought it to its shelter.

"Because he bit someone — and broke skin — he is on a mandatory 10-day observation hold for rabies protocol," said Deb Campbell, a spokesperson for the San Francisco Animal Care and Control.

The incident will be reviewed by the San Francisco Police Department's Vicious and Dangerous Dog Unit within 10 days and "the outcome for this dog" will be determined, Campbell added.

The library said that it's reviewing its service animal policy. "The safety of our patrons and staff are of the utmost importance, and we are doing everything we can to ensure that this never happens again," the library was cited as saying by KTVU. It said it was also looking for additional resources for its security staff to help subdue aggressive behavior from dogs.

Representation. Pixabay