She was assigned to the 46th Precinct in the northwest Bronx before an on-duty leg injury resulted in her being sent to the Bronx courts, a sometimes glum place where her sunny disposition and her desire to be active set her apart. She had made 76 arrests over her career, 23 of them in felonies. She had recently been assigned to the R.V.-style truck stationed on East 183rd Street, which was put there as a deterrent to a rash of gang- and crew-related shootings, among them a daytime triple shooting. The police arrested a man in March in connection with that crime. A law enforcement official said two crews on opposite sides of the Grand Concourse had been warring.

For some residents who said the city too often skimps on police resources in the Bronx, the mobile command post offered a measure of assurance.

Three miles south, outside the apartment where Mr. Bonds lived on the Rev. James A. Polite Avenue in the Morrisania neighborhood, residents said he had often spoken with addicts before they took drug purchases from other men on the block. He had been on parole since May 2013, after being locked up for eight years on a robbery conviction in Syracuse. He had also been convicted of selling drugs near a school and had been arrested on suspicion of punching an officer in Queens in 2001 with brass knuckles.

Image Alexander Bonds in April 2013. Credit... New York State Department of Corrections and Community Supervision

Since his release in 2013, though, he appeared to have minimal police contact and had complied with the conditions of his parole. In the video he posted online about the police, many of his complaints stemmed from what he described as dangerous conditions in state prisons and a lack of accountability for guards.

On July 4, Mr. Bonds returned from work at a fast-food restaurant around 7:30 p.m. and began drinking with friends on the corner, a neighbor said.

His behavior alarmed his girlfriend, who, around 9 p.m., called the police several times as she followed him down a street farther south in the Bronx and reported that he was paranoid and manic, a law enforcement official said. Asked by the operator if he was armed or violent, the girlfriend said no, the official said.