IO DE JANEIRO, June 27 Gang leaders had taken control of the weekend funk dances in the neighborhood, selling drugs openly and forcing young girls to have sex with them. The police had been alerted but had done nothing, so the residents of the slum known as the Favela da Grota turned, like so many others here before them, to the crusading crime reporter Tim Lopes.
Mr. Lopes was last seen on the night of June 2, on his way to one of the raucous dances. The charred remains of the camera he was carrying have been found, but Mr. Lopes never returned, and two gunmen for the drug lord who controls the neighborhood have horrified the city by boasting to reporters and police officers that he was kidnapped and killed on orders of their boss.
Press and rights groups here and abroad have condemned the killing, with the Inter-American Press Association warning that "criminals and organized crime are defining the limits of freedom of expression" here. But for Rio's 5.8 million residents, the death of one of the city's best-known reporters is the most chilling demonstration yet that hillside shantytowns here have become gang fiefs.
"We are seeing the emergence of a new form of criminal organization, one that actually controls and governs a geographically defined territory," said Walter Maierovitch, Brazil's former anti-drug czar. "These gangs have become a challenge to the state, parallel governments that threaten Brazil's democracy and the rule of law."
Mr. Lopes, 50, specialized in undercover investigations, often using a miniature camera and microphone hidden on his body. He dressed up as Santa Claus for one investigative report, spent two months as a drug rehab patient to obtain another, and last year won Brazil's equivalent of the Pulitzer Prize for a vivid account of open-air drug markets in Rio's favelas, as the city's 513 squatter settlements are called in Portuguese.
It was that report that led residents of the Favela da Grota to place their confidence in Mr. Lopes, himself born in a slum here, instead of the police, who are widely viewed as corrupt and incompetent. The slum dwellers hoped that their plight would be publicized on "Fantástico," a popular Sunday night television program that is a cross between "60 Minutes" and "Inside Edition."
The police now say that Mr. Lopes was executed by Elias Pereira da Silva, a powerful drug lord known in local tabloids as "Elias the Madman. The two garrulous gang members, who are in police custody, said that they saw the reporter being shot in the feet to prevent him from fleeing. Then, they said, he was tortured and cut to pieces with a samurai sword, after which his body was burned.
Mr. da Silva, a main leader of a powerful crime group known as the Red Command, was accused of killing four police officers in 1993 and in 1996 was jailed on drug charges. But he was released two years ago after police officers failed to show up to testify against him in court hearings, enabling his lawyers to file a successful habeas corpus petition.
Since then, Mr. da Silva, 35, and other gang leaders have become even more powerful, enforcing their will through intimidation and violence. "They are the law, the only law, and you have to obey them whether you like it or not," said Clarissa Fonseca de Bastos, a street vendor who lives in a favela known as the Morro da Formiga, or Anthill.
In some neighborhoods, residents say, drug lords now determine when stores and schools open and close, who can enter or leave and where and how houses can be built. Their authority is most pronounced in the favelas, which are home to more than a million of Rio's residents, but it is also beginning to extend to middle-class neighborhoods.
A European journalist living here, for example, was recently approached by subordinates of the drug dealer who controls a nearby favela. They said "the boss" had ordered her to trim a 100-year-old tree that was blocking his view of an approach road used by the police.
The reporter refused, not wanting to put her home in the line of fire. But after a burst of gunfire just outside her house that day, she told the gang members that they could trim the tree themselves if they desired.
Better armed than the police and increasingly bold, gangs have even begun to attack government offices. The windows of City Hall were shot out this week. Last month grenades were thrown and machine guns fired at the state Secretariat of Human Rights while senior officials met inside; in another gang assault, the secretary of economic development and five other people were taken hostage at their office.
"From here on in," read a note signed by the Red Command and left behind at the human rights office, "any arbitrary action against our jailed brethren will be answered in kind with bullets."
In another recent incident, a midafternoon shootout between the Red Command and its main rival, the Third Command, forced the closing of one of the city's main tunnels, which comes out near the state governor's residence. At night, gangs routinely block tunnels or set up checkpoints on isolated streets, unhampered by the police, and rob or kidnap unwary motorists.
Even more ominously, drug lords are increasingly acting as judge, jury and executioner, a development actually welcomed by some slum residents in the absence of the police. While searching for Mr. Lopes's body, a police team discovered a clandestine cemetery with the remains of an estimated 50 people sentenced to death, residents said, by gang "tribunals."
The new governor of the state of Rio de Janeiro, Benedita da Silva, has promised to put more officers on the streets. But shantytown residents say the main problem is not the number of officers but their unwillingness to confront criminal gangs.
"At the first burst of gunfire, the police always turn and run away," said Geraldo Lopes Bulhoes, a street sweeper who lives in a slum called Vidigal, adding, "We have no one to protect us, no one at all."