Police forces across the country were on high alert Sunday afternoon after at least three officers were shot and killed in Baton Rouge, with some major cities telling cops to walk the streets in pairs.

"There are to be no solo foot posts citywide," the New York City Police Department said in a bulletin to law enforcement personnel. "All uniform members of service shall arrive and remain on post together. All meals and personal breaks will also be taken in pairs."

In an earlier tweet, the Boston Police Department instructed officers to "use caution and remain vigilant in their patrols."

Police agencies around the U.S. have grappled with the safety of officers in recent days after the July 7 ambush of law enforcement officers in Dallas, Texas, and the arrest of five people in Louisiana in an alleged plot to kill cops.

The killings in Dallas are believed to have been inspired by recent police shootings — especially Alton Sterling in Baton Rouge and Philando Castile in the Minneapolis suburb of St. Anthony — which have reignited the roiling national debate over police tactics and race.