The NYPD has arrested four people on charges they made terroristic threats against police or called in false reports, officials said Wednesday.

Local law enforcement officials along with other police agencies are also looking into about a half-dozen other cases of threats made against law enforcement as the NYPD cautioned its rank and file to be on guard for potential trouble.

"Although, we have made four arrests, officers are advised to remain vigilant at all times," the NYPD said in a statement Wednesday.

"Additionally, security measures will continue to be assessed and police resources will be deployed accordingly," the department said.

Police beefed up security late Tuesday at the 79th and 81st precincts in Brooklyn after an informant passed along information about threats that were reportedly made against police officers there. The precincts were not far from were officers Wenjian Liu and Rafael Ramos were gunned down on Saturday.

A total of 40 threat cases have been received by the NYPD from a variety of law enforcement agencies and online sources, as well as 911 and 311 calls, said law enforcement officials. About 24 of the cases were closed, 15 remain open and eight were referred to other law enforcement agencies, said one official who didn't want to be named.

"Out of all of that, a handful are of concern," said John Miller, head of NYPD intelligence and counterterrorism.

"A lot are just angry people blowing off steam with inappropriate comments," said the official. "Some guy says 'I was drunk and didn't mean it' . . . About a half-dozen at any one time are concerning."

Some of the postings on social media show people posing with guns and making threatening remarks, said the official, who added that about eight have been referred to local law enforcement agencies where the subject lives.

The four arrests made locally involve city residents charged with either the making of terroristic threats or filing false reports about others making such threats, said an NYPD spokesman. In one case, a 46-year-old Queens tow truck driver allegedly made a call to police saying he overheard one of his clients make a threat against police. The tow truck operator was charged with filing a false report, said the spokesman.

Mayor Bill de Blasio said Wednesday in a statement that "Cowardly threats of violence against the brave men and women of our police force will not be tolerated."

Separately, de Blasio chided demonstrators who marched in Manhattan Tuesday night and disregarded his call for a moratorium on the protests over police conduct while the city is mourning the deaths of Liu and Ramos.

"It's deeply divisive to hold political protests during this period of remembrance," de Blasio said in a statement. "Chants by those on the fringe comparing our police to the KKK are not the voices of a credible cause. They are hateful words that attempt to divide this city in a time when we need to come together."

The mayor and other city officials have tried to mend fences with police, who contend City Hall helped fuel some of the divisive behavior. De Blasio visited a makeshift memorial in Brooklyn for the fallen officers on Tuesday. Relatives of Ramos also paid respects Tuesday.

Wednesday, Pei Xia Chen, Liu's widow, and members of his immediate family also visited the site.

With Emily Ngo