Newly discovered emails, first reported by The Appeal, show how officers from the New York City Police Department went to extreme lengths to monitor active members of the Black Lives Matter movement.

The emails, which were obtained through an information request, showed officers had used undercover "sources" to infiltrate protests and kept photos of activists for years.

The emails were obtained by a lawyer who grew suspicious after police repeatedly showed up to and stifled protests soon after they began across the city.

Newly discovered emails show how officers from the New York City Police Department went to extreme lengths to monitor active members of the Black Lives Matter movement and maintained identifying information on activists for years.

Nearly 700 emails show the NYPD coordinated with undercover "sources" to infiltrate the protests from November 2014 to January 2015, filmed many of the activists, and kept dozens of photos of activists for years since the protests declined.

The emails also show that officers referred to protestors as "idiots" and "ninjas" when tracking them across the city. Officers names were redacted in the emails.

The emails were obtained by lawyer M.J. Williams, through a Freedom of Information request after she grew suspicious that police had obtained inside information that allowed them to quickly confront and stifle protests across the city.

The Appeal, which first reported the new release, noted that these emails may prove a violation of the Handschu Guidelines, a set of protest regulations that allow the NYPD to attend protests and monitor for safety, but forbid them retaining any information from protests unless it "relates to potential unlawful or terrorist activity."

Mayor Bill DeBlasio and NYPD Commissioner James O'Neill issued contrasting responses to the discovery, with the NYPD head defending the practice and waving off ethics concerns.

"I'm not really gonna go into what technology we have and we don't have, but we do not interfere with the constitutionally protected activities," O'Neill said on WNYC. "We're looking to building trust with all 8.6 million New Yorkers. That wouldn't be the way to do it."

Read more: New York City streets just had their safest year in recorded history, but there’s still plenty of room for improvement

Deblasio told the New York Post that he was "concerned" by the emails, and was confused as to why the department would need to closely monitor non-violent protest.

"I have not seen details but I want to confirm publicly that Black Lives Matter is a non-violent political movement that I don’t always agree with but I think is trying to achieve important goals and has played a productive role in this country," he said.

DeBlasio added, "I have no understanding of why there would need to be any monitoring, so I will, of course, wait for the details but they are not a security risk in any way shape or form.

In a separate case decided earlier this week, the department was ordered to turn over records relating to cell phone and social media tracking of activists. The NYPD told the court it would consult with legal sources before deciding on releasing the records.