The residents of the southeast Liverpool neighborhood of Edge Hill had spent Wednesday preparing for trouble.

Parents were called to pick up children early from nursery school. Shop owners pulled their shutters down over glass storefronts. And in the semidetached brick houses on and around Overbury Street, where generations of the same families have lived alongside newer arrivals, locals pulled their curtains as evening approached.

What they feared was another night of the anti-immigrant violence that had rocked the country in the week since a deadly stabbing attack nearby in Southport that was falsely rumored as being carried out by a migrant.

What they got, instead, was a night of near celebration by people opposed to the racism and anti-immigrant sentiments that drove the week of rioting in cities and towns across Britain.

People in Liverpool had been especially unnerved since an online list of what were said to be new far-right targets for protests included a local charity that works with asylum seekers. Neighbors texted neighbors to head to the streets to counter any racist rioters. Local unions and leaders of neighborhood mosques also put out the word, as did a nationwide collective called “Stand Up to Racism.”

So as helicopters circled overhead on Wednesday night, and police officers on horseback patrolled the streets, young women handed out snacks and water bottles in front of the boarded-up windows of the targeted charity. Another group set up a makeshift first aid area across the street in case of emergency, given the unbridled violence of the past riots. And a white-haired man with a long beard propped a megaphone next to a speaker on his metal walker and played peace songs.