Last summer, as New York City was in the throes of a migrant influx from the southern border, residents near the Brooklyn Navy Yard began to notice a growing number of African and Latin American migrants milling around the neighborhood’s parks and sidewalks.

The reason soon became clear. A block away, the city had quietly begun sheltering migrants inside an empty 10-building office compound. Over the next few months, it would become one of the city’s biggest shelter complexes — housing more than 4,000 migrants just a few blocks from a residential neighborhood.

The gargantuan scale of the shelters swiftly tested nearby residents in the liberal enclave of Clinton Hill. Their willingness to welcome migrants soon gave way to a litany of quality-of-life complaints, from littering and loitering to concerns about safety, leading to crowded town-hall meetings and pressure on Mayor Eric Adams to reverse course.

Then, this summer, some of their worst fears came to fruition.

On the night of July 21, a migrant man was shot and killed at a park near the shelter. A few minutes later, two other Venezuelan migrants were fatally shot outside the shelter after two men rode by on a moped and one of them opened fire in an incident that the police believe was tied to Venezuelan gangs.

The shootings, which do not appear related, escalated anxieties among some neighborhood residents already on edge after a stabbing outside the shelter in June.