“We’re not picking fights with the good people,” Officer Helgerson said, noting the cups many held and surmising that most contained alcohol. “Technically, everybody with these cups in their hands could get a summons. But you’ve got to give these people a chance to go home.”

Image The police found a loaded handgun in Haffen Park after a nonfatal shooting. Credit... Kirsten Luce for The New York Times

They drove on.

Around 11 p.m., the officers parked alongside the lieutenant, Michael Raso, who took their memo books to inspect as they discussed the relative calm in a precinct that had seen a decline in shootings and homicides compared with the previous, very violent year.

The shooting, moments later, took place near the basketball courts, a spot that Officers Helgerson and Vega had passed by during their drive through the park.

For a chaotic few seconds, it was not clear that Mark Clarke, 20, had been shot in the leg. He crashed into the nursing home at such speed — and seemed to be gripping his pants — that the employees shouted “he’s got a gun” as Officers Helgerson and Vega ran in after him. Several other officers joined, rushing through the sliding glass door.

Inside, Officer Vega said, Mr. Clarke pushed his way through the first-floor hallway and took a left down a few stairs, apparently believing it was a staircase. It was a dead end. The officers, guns drawn, yelled for him to put his hands up and took him to the ground. No shots were fired. Officer Vega said it was then that he realized Mr. Clarke’s shorts were soaked with blood.

“You have the shooting victim running from the scene, and when we ran through the door everyone was yelling that he had a gun on him,” Lieutenant Raso said minutes after. “That could have gone really bad. But it didn’t. Because of the way these cops are here.”