The morning after tens of thousands of people thronged streets across Brazil to express their anger over the murder of black, gay Rio councillor Marielle Franco, it was business as usual in the Maré favela where she grew up. Armed drug gang members openly patrolled behind a police base.

The favela is hidden from the roaring highway that connects the nearby international airport to Rio’s centre by an opaque plastic fence. Authorities call it an “acoustic barrier”. Local people scoff and say it is there to hide their ramshackle but vibrant community from tourists, noting that in front of the nearby new schools the fence is transparent. It is symptomatic of how Brazilian authorities see the favelas that house almost a quarter of Rio’s population: as places to be hidden, abandoned to gangs, and occasionally invaded by police in armoured cars who don’t care who gets killed in the crossfire.

“This is a feudal system. The state is not in charge here,” said Alberto Aleixo, president of a local non-profit group called Maré Networks that offers culture and education.

Just yards from the locked back gates of the police barracks, a man in a baseball cap with a machine-gun slung around his neck rode past on a motorbike – a footsoldier for the Red Command gang, which runs a drugs market in an alley near the favela’s entrance. “These guys are in charge here,” said Aleixo.

Franco’s death last week at 38 – a carefully targeted shooting by apparently professional killers – sent shockwaves across the world and is forcing Brazilians to ask searching questions about their country’s inherent racism, violence and culture of impunity. European parliament deputies condemned the killing. Brazil’s prosecutor general, Raquel Dodge, called it an attack on democracy. The great Brazilian music star Caetano Veloso wrote a song for her.

Aleixo had known her for years, ever since they campaigned together against the Rio police’s introduction of armoured vehicles in 2006. “She always had an opinion, and a desire to find a solution,” he said.

Facebook Twitter Pinterest Protesters over Franco’s killing outside Rio’s municipal chamber on Thursday. Photograph: Mauro Pimentel/AFP/Getty Images

Franco fought for the rights of women, single mothers like herself, gay people and favela residents. She denounced the violence inflicted by Rio’s police on the community as they fight – and occasionally collude – with the drug gangs and another force active on the streets: the unofficial militias whose members include serving and former police officers.

In Rio state 154 people were killed “in opposition to police intervention” in January alone, 57% up year-on-year. Many think this is the reason Franco and her driver, Anderson Gomes, were riddled with bullets last Wednesday night – and fear the killing will discourage others like her.

“She knew what she was doing for us,” said Sonia Vieira, 64, a Maré pensioner who had voted for Franco. “Whenever someone comes along who can do this, they get rid of them.”

Franco’s death has come as a divided and desperately unequal country struggles through troubled times. The worst recession in recent history has hit poor communities like Maré hard. Liberal economists blame the economic policies of leftwing former president Dilma Rousseff, controversially impeached for breaking budget rules amid revelations of a sprawling corruption scheme involving her party and its allies.

Her former vice-president, Michel Temer – whose party plotted to oust Rousseff – took over and introduced austerity measures to cut soaring spending, cutting benefits to the poor.

With support for Brazil’s tainted politicians at an all-time low, Franco’s triumphant win of a city council seat for a small leftwing party in 2016 presented a rare glimmer of hope for a country in urgent need of political renewal. It was especially so in Rio, where the former state governor is in jail and the state is virtually bankrupt.

She was an educated, articulate, and capable young woman from a favela: a far cry from the moneyed, middle-aged, white male politicians Brazilians are accustomed to, in a country where more than half the population is black or mixed-race.

“She represented renewal,” said Ernani da Conceição, a Maré teacher who taught Franco the classes that helped her get a scholarship at Rio’s prestigious Pontifical Catholic University. He and other locals described how Franco began her political education in the local Catholic church, at a time when churches were influenced by Latin America’s leftwing “liberation theology” and offered safe, neutral spaces for debate. As a teenager, she was a church volunteer and worked in a creche.

She became militant after a friend was killed by a stray bullet in a shootout between police and gang members, and she joined a pre-university course at the Maré Centre for Studies and Solidarity Action, known as CEASM in Portuguese. At 19, she became pregnant and had a daughter.

“She wanted to be different,” said Vera de Carvalho, 54, whose daughter Amanda was a close friend of Franco. “She had ambition. She wanted to be someone.”

Facebook Twitter Pinterest Mourners remembering Franco last week in Rio. Photograph: Marcelo Sayao/EPA

Franco got a scholarship to study for a social sciences degree and later a master’s in public administration.Lourenço da Silva, 47, a fellow CEASM student who also won a scholarship, remembered her balancing political activism, studies and caring for a young child as a single mother. “Everything you gave her to do, she did,” he said. Both he and Carvalho work at the Maré Museum, a community project that documents how the favela once consisted of wooden shacks on stilts above the sea.

CEASM’s Antonio Carlos Vieira said the project’s aim was to educate and politicise Maré’s young people, who would then come back and work for their communities, forming a generation of favela intellectuals. “Marielle was the best example of this,” he said.

Franco worked for Marcelo Freixo, a deputy in Rio’s state legislature for the Socialism and Freedom party, who has twice stood for mayor. Freixo was placed under protection after leading an inquiry into the involvement of police and politicians in militias. Franco stood for the same party, receiving the fifth highest number of votes. She moved out of Maré into an apartment with her partner, Mônica.

“She was one of my best friends,” Freixo said. “A very, very strong, brave person, but very sensible, with an unforgettable smile.”

A red-eyed Freixo helped carry Franco’s coffin past thousands of weeping mourners into a ceremony at Rio’s council chambers on Thursday afternoon. Since her death she has dominated the Brazilian press and social media as she never did in life, forcing a debate over many of the issues she championed: racism and representation, LGBT rights, and violence against the poor.

Brazilians are now calculating their loss. Ricardo Ismael – Franco’s course tutor for her social sciences degree – said Brazil had lost a capable new political leader. “She was already standing out in terms of debate, leadership capacity and intellect,” he said.

Her murder has also focused attention as never before on the “federal intervention” decreed by President Temer a month earlier, in which he cited rising crime as a reason to put the army in charge of Rio’s state police forces and prisons. Franco attacked the intervention and served on a council commission to oversee it.

Unnamed police officers and prosecutors have told Reuters they believe her murder may have been linked to her political work or her denouncing of police abuses. On Friday, Brazilian media reported that the bullets that killed her were part of a batch sold to federal police in Brasília in 2006; the public security minister, Raul Jungmann, said they had been stolen from a post office.

In 2015 Maré emerged from a 15-month occupation by the army, the benefits of which were invisible on Friday morning. On the other side of a drainage ditch, a few hundred yards from the Red Command, the Pure Third Command gang dominates. Houses and schools are flecked with bullet holes. Young men carry pistols and radios.

Some residents collect birds. Retired João Cardoso, 53, recently sold one he had called Gaza Strip, named after this stretch of the favela. He hadn’t voted for Franco, but remembered her fondly. “She had a vision for the less fortunate people,” he said. “She was a good person.”