Prior to the shooting, Bratton said Brinsley went to the home of a former girlfriend around 5:45 a.m. Saturday in the Baltimore area and shot and wounded her.

Police there said they noticed Brinsley posting to the woman’s Instagram account about a threat to New York officers.

After the shooting in Baltimore, Bratton said Baltimore authorities sent a wanted flier to the NYPD and other agencies, warning them of Brinsley. Bratton said it was sent at essentially the same time the officers were being ambushed by the suspect.

Baltimore Mayor Stephanie Rawlings-Blake said in a statement she is troubled to learn Brinsley started his crime spree in her community, WNEW’s Heather Curtis reported.

Rawlings-Blake’s deputy chief of staff, Kevin Harris, said the mayor knows there are a few bad apples that have “done some things that do not honor the uniform,” and they need to deal with that.

“But the way in which they do that is not to target law enforcement,” Harris told Curtis.

2 NYPD Officers Killed In 'Execution-Style' Shooting In Brooklyn

Bratton said it was also found that the suspect had a connection to East Flatbush, Brooklyn. Brinsley does not appear to have any ties or connections to any terrorist groups, Bratton said.

GALLERY: Comm. Bratton, Mayor De Blasio Give Remarks After 2 NYPD Officers Gunned Down

The NYPD will be working with Baltimore police to find a motive for the murder and what brought Brinsley to New York City, Bratton said.

“It is an attack on all of us. It is an attack on all that we hold dear,” Mayor Bill de Blasio said at the news conference, alongside Bratton.

De Blasio urged the public to come forward and immediately report any possible attacks against law enforcement.

“Everybody is feeling different things but I don’t think anybody in their right mind called for the death of an officer,” City Councilman Robert Cornegy said.

“People are frustrated with the results of Staten Island and Eric Garner, but I don’t think I know anyone in this community that would agree with taking the lives of an officer,” Cornegy added.

“If you’re mad at somebody, be mad at the person you need to be mad at don’t take two innocent people from their families. Don’t do that,” another witness told 1010 WINS.

Sources tell CBS2 officers are being warned to be aware of their security both on and off the job.