A man who an anonymous tipster claimed had pledged his allegiance to ISIS and was planning to shoot police officers in New York and Philadelphia has turned himself in to police, law enforcement sources told NBC 4 New York.

The man turned himself in at a Bronx police precinct Wednesday afternoon and was questioned by detectives, sources said. He was not charged with any crime, but was being held Thursday for allegedly violating his parole.

The NYPD had issued an alert to officers on Wednesday about the anonymous tip called in to a detective squad about a local man who may be armed and prepared to shoot a cop in New York City. Police in Philadelphia also received a similar threat.

According to authorities, the suspect mentioned by the New York City tipster had pledged allegiance to ISIS.

Both calls were traced to upper Manhattan, officials say.

Patrick Lynch, the president of the NYPD's rank-and-file union, reminded police to be on alert for potential threats.

"New York City police officers recognize that they are always a potential target for terrorists and political extremists," Lynch said. "The PBA is reminding all of our members to be alert at all times, back each other up and to take all necessary precautions when responding to jobs."

The threat comes just weeks after a cop in Philadelphia was shot three times by a man who allegedly pledged to ISIS. The cop, Jesse Hartnett, was wounded but was able to shoot the alleged gunman, Edward Archer.

And in 2014, a man hacked at two cops with a hatchet in Queens, critically injuring one. The attack was considered an act of terror, and FBI Director James Comey said that the suspect, Zale Thompson, appeared to have sought "inspiration from foreign terrorist sources" including ISIS.

Also that year, Ismaaiyl Abdullah Brinsley, the man who killed NYPD officers Wenjian Liu and Rafael Ramos, posted to Instagram that he was "putting Wings on Pigs" before the Brooklyn shooting.

-- Jonathan Dienst contributed to this story.