Warning: Footage may be disturbing to viewers.

The NBC4 I-Team has uncovered hundreds of disturbing incidents reported at Los Angeles city libraries, many that put the safety of employees and the public at risk.

Since 2016, the LA City Library has recorded close to 2000 security incidents, including assaults on employees and visitors, death threats, theft, drug use, lewd behavior and vandalism.

The I-Team discovered the incidents while reviewing thousands of pages of internal LA Library documents, obtained through public records requests.

Among the documents we obtained were a list of people banned from entering any LA City library for inappropriate or dangerous behaviors, including "hitting patrons with a metal pipe," "masturbating and spreading bodily fluids on several library computers," and "unwanted touching of a teenage female." The city has sent letters to 490 such people in the last three years, telling them their privilege to enter any library was "suspended."

The City Attorney's office has also granted dozens of temporary restraining orders against people who've assaulted or threatened library staff members, all obtained by the I-Team. In one case, a person brandished a one-foot machete at a librarian.

Several others were banned from libraries for exposing themselves in front of children.

Surveillance footage obtained by the I-Team shows a man entering the lobby of the Venice library branch on June 27, 2015, dropping his pants, and exposing his genitals to staff and visitors. The footage shows the man running around the room as children weep and cover their eyes. The staff chases him out and locks the front door, but the man refuses to leave, pressing his naked body against the glass door as library volunteers struggle to block the view from the people inside. Court documents indicate the man was later prosecuted for lewd conduct, then ordered to receive mental health treatment.

On Sept. 9 of this year, a surveillance camera recorded another man stripping naked in the lobby of the Jefferson branch, then pursuing a staff member who barricaded herself in a back room until police arrived to detain him. Fearing for her safety, the employee later obtained a temporary restraining order to keep the man out of the library.

"[We] have been punched in the face…threatened with physical harm and with death," said one veteran librarian who asked to have their identity concealed, concerned that speaking out about dangerous people at libraries could have negative professional consequences. "There are a lot of mentally unstable people who come into the library, and you don’t know what they’re going to do."

City officials admit that LA’s libraries have become a magnet for the homeless and the mentally ill, seeking refuge from life on the streets, in a town that lacks sufficient mental health services and housing for transients.

Steve Albrecht is a former law enforcement officer who now advises libraries around the country about security and safety issues, including ways to deal with the mentally ill population. He says another danger is what appears to be rampant drug use in and around libraries, something the I-Team has documented extensively.

"People [who] smoke drugs and come inside the library do pose a safety problem because their behavior is erratic," said Albrecht. "It's dangerous for staff and dangerous for the patrons."

The library has now installed hidden panic buttons in all 73 branches, so employees can summon police without having to pick up the phone. But with security guards or police officers are only assigned to just 29 of 73 branches. Numerous librarians tell NBC4 there should be guards at every branch.

"The truth needs to be out there," said the veteran librarian. "We need better security coverage in the libraries."

City Librarian John Szabo agrees that security is a major issue for the LA Public Library system, which is the nation’s largest. "[The libraries] are absolutely not as safe as I’d like them to be," Szabo told the I-Team.

The library's current security budget is $5,420,337. A spokeswoman tells the I-Team the library has requested an additional $927,495 for security in the next budget year, but says the Los Angeles Police Department "ultimately decides how best to spend resources and deploy staff."

For more than a month, the I-Team has been asking Mayor Eric Garcetti to discuss the dangers at L.A. libraries, since he appoints the people who oversee the system. First, a spokesman said the mayor was too busy; in recent days, the office has not responded to repeated I-Team emails and calls.