Caught on camera: Guard attacked by pitbull in San Francisco Public Library

A San Francisco Public Library security guard is recovering, after being attacked by a patron's pitbull on Sunday. The entire attack was captured on cell phone video and posted to social media.

"It was a vicious attack," said San Francisco City Librarian Michael Lambert. "It was about 20 minutes before closing on Sunday at our main library."

The librarian says a pair of security guards were making routine rounds when they encountered a man, unconscious at a computer desk. His dog was roaming around.

The guards attempted to wake up the patron, but were unable to rouse him.

As illegal drug use is all too common in the surrounding neighborhood, Lambert says the guards began to consider administering Narcan, when the dog attacked one of them.

MORE: All the employees at Noah's Bagels in Vacaville quit in viral video

Two guards jumped in to help, but were unable to pull the dog from the guard's wrist. 

That's when library officials say the dog's owner regained consciousness, without the aid of Narcan.

"At some point they were able to get their dog secured," said Lambert.

Paramedics rushed in to treat the guard, while Animal Control took the dog into custody. The owner, who told sheriff's deputies that his dog was a service dog, was cited by for failure to maintain control of his animal.

"We don’t allow pets inside the library, but individuals who indicate that they have a service animal, and that the animal performs a specific task for them, are allowed to bring their animal inside the building," said Lambert.

The right to service animals is protected under the Americans with Disabilities Act. Still, the Library says it is reviewing its policies.

"We’re going to exhaust all of our options in looking at how we can keep our staff and our patrons safe," said Lambert.

The security guard was taken to a local hospital, where library officials say he was treated for "serious injuries." He is currently recovering at home.