Juliana Barbassa is an award-winning journalist and author of "Dancing with the Devil in the City of God: Rio de Janeiro on the Brink."

Relatives and friends of a teenager who was shot and killed walk to his burial in Rio de Janeiro on Sept. 30, 2015. Five police officers were taken into custody for allegedly altering a crime scene by placing a gun in the hand of the 17-year-old after they allegedly killed him during a shootout. (Silvia Izquierdo/AP)

Every Wednesday, a farmers’ market would spring up in the cobblestoned square facing my Rio de Janeiro apartment. The clank and bang of vendors building makeshift stalls woke me up at dawn, and their beckoning calls kept me company as I worked: Watermelon! Figs! Strawberries to sweeten your mother-in-law’s temper!

But on one particular Wednesday in March 2014, here’s what I heard: “Beat him up. Teach him a lesson. Give him what he deserves.” Initially, I didn’t know what was happening, but the words sent a flush of adrenaline tingling into my fingers. When I pushed through the crowd and figured out what was going on, what I saw left me searching for answers.

I am a journalist. In 2010, I moved to Brazil — the country where I’d been born, but left as a child — as a correspondent for a news agency. The headlines drew me back. Brazil’s economy was booming, the middle class was expanding, social inequality that had long marred the country was shrinking a bit. In quick succession, the country would host the 2014 World Cup and the 2016 Olympics, international events that would test this new Brazil and thrust it into the spotlight. If the old joke had been that Brazil was, perpetually, “the country of the future,” the future seemed upon us. As a reporter, it was the place to be.

But I had also come to walk in a market where everyone spoke the language of my childhood, to be greeted with a kiss by the elderly merchant with a sweeping white mustache, to lose myself in this city, and find out what it meant to be of this place, a Brazilian in Brazil. That cozy square with its familiar faces, its black-and-white mosaic walkways and its view of the Sugarloaf peak was an anchor in this bewildering city.

Typically, around 11 a.m. on these days, I’d roll away from the computer, take the elevator down, and step outside, across the street and into the square, among the bright green heaps of lettuce, the dark collards still smelling of wet soil and the fragrant architecture of tropical fruit — pyramids of mangoes, ramparts of apples, pineapples whose prickly crowns fell to the clean sweep of the vendor’s machete and papaya so large I carried mine cradled in the crook of an arm, as if it were a baby.

And on that particular Wednesday, I made the full round of the market, passing the flower stalls with their jarring reds and pinks, when I saw the way out was blocked. Up ahead, just beyond the stands, was the street, and beyond it, residential buildings. My building. All I could see was a dense cluster of shirtless men, men in tank-tops, well-coiffed women with their grocery carts, maids in uniforms, all of them standing, shoulder shoving against shoulder.

I couldn’t see anything, but I heard the voices that overlapped above saying “Beat him up. Teach him a lesson. Give him what he deserves.”

I pushed to the front and I saw two men and a teenager holding a boy, shoving him back and forth. They were yelling something. I strained to hear.

One man managed to wrap his arm around the boy’s neck and grab the loose fabric at the collar of the boy’s shirt in a tight grip. His other fist struck the child on the head. The kid flailed, flung his arms about his face and pedaled his legs in the air, kicking wherever he made contact.

“What happened?” I asked no one in particular. Someone said the boy had taken a woman’s purse. All around us, voices egged these men on. “Show him! Tie him to a post,” one man said, a reference to an incident in which a homeless kid suspected of robbing people in the neighborhood was stripped, beaten and chained by his neck to a light post by vigilantes two months prior. It happened there in Flamengo, my neighborhood, just around the corner from this market with its neat geometry of tropical fruit and its buckets of flowers.

The man who spoke was standing at the edge of the crowd; thick-necked, stripped to the waist, with a round, hard paunch protruding over his board shorts, he could have been any of the vendors, anyone in Rio. His face was split in a grin.

The episode underscored one of the most trying aspects of life in this city: the violence that crackled just under the surface. It could erupt in unpredictable ways, as when the bus driver intentionally jostled passengers or swiped a biker after being trapped behind the wheel for too long with too little pay; or in routine revolts, in which workers facing long commutes stoned or burned the suburban trains that broke down with regularity. It also had harsher manifestations, like Brazil’s stubborn homicide rate, which refused to budge despite the optimism and prosperity of the last decade. And the lethal police force. In the state of Rio de Janeiro alone, officers have reportedly killed 1,500 people over five years.

There are explanations for this culture of violence. As a journalist, I’d interviewed experts and catalogued them: the economic inequality that remains among the highest in the world; inefficient and often corrupt courts and law enforcement agencies that make impunity the rule; a complete lack of trust in government institutions.

But the particular strain of violence on display in the market that day — the mob lynching — leaves me grasping. Every day, according to sociologist José de Souza Martins, at least one person is lynched in Brazil. Since 2011, he’s tallied over 2,500 cases. This surge of vigilantism has been attributed to a twisted desire for justice and release. But numbers and definitions do not help me make sense of it — not of the horror of the public thrashings and not of the social acceptance of the phenomenon.

When the teenage boy was beaten and chained by the neck to a post that January, a controversial television commentator, Rachel Sheherazade, called it “collective self-defense.”

“Since the local government is weak, the police is demoralized and the legal system is a failure, what is left to the good citizen but to defend himself?” she asked.

Neighborhood watchdog sites and online forums were filled with comments; some calling for calm but others praising the aggressors.

“Wake up you idiots … people in Flamengo know he’s a THIEF who robs elderly ladies and women every day. What they did wasn’t enough,” one man had written.

“A good criminal is a dead criminal,” posted another, offering up an old refrain.

Reading these messages, it struck me that the people saying these things are my neighbors. They jog by me in the park, nodding their good mornings and queue up with me at the bank. They’re the same people who belly up to the stands at the farmers market, pressing their fingers lightly into the flesh of avocados, testing for ripeness.

I thought of this as I stood at the edge of the market in March, the plastic straps of shopping bags cutting into my forearms, the trampled remains of spoiled fruit souring under the noonday sun.

I wanted to do something, say something, stop them. I walked toward the men who were pushing the boy inside the gate of one of the buildings and I was terrified — for the boy; for all of us standing there, on the brink of something; and for what that something said about the country I’d come searching for.

Once we were face to face, though, the words didn’t come. I reverted to habit, as if I were just a reporter on the job and this were another incident I had to cover. “What are your names?” I asked the vigilantes.

They looked up. “We’re police,” one of the men said. Go back to your house.

Maybe they were. Maybe they weren’t. In Rio, however, this didn’t provide reassurance, but its opposite. It was a reminder there was no help for that boy, from law enforcement or anyone else. Everyone there knew it. Standing there with my bags of produce and my presumption what was I going to do, take their names? Denounce them? To whom? Who cared? I felt deflated and exposed in my naivete.

I turned away and headed to the gated entrance of my building, aware that this shard of violence was embedded in me now, as it was in my city, my country, my home.