RIO DE JANEIRO, Brazil (AP) _ Dozens of hooded gunmen stormed a Rio slum Monday, killing at least 20 people and setting fires. Residents blamed police for the deaths, which followed mass killings of street kids and jungle Indians.

''It was a massacre. Women and children were machine-gunned,'' Col. Abilio Faria, a spokesman for the Rio de Janeiro state police. He said up to 24 people may have been killed.

He said it was too early to tell who was responsible for the shootings.

But many residents said the killings were in retaliation for the murder of four police in the same area Saturday. Those deaths were blamed on drug traffickers in the shantytown.

Meanwhile, federal investigators reported Monday that the massacre of Stone Age Yanomami Indians occurred in neighboring Venezuela, and that 18 Indians were killed, not up to 73 as previously reported.

Sydney Lemos, federal police chief of the northwestern state of Roraima, said a satellite test done Monday showed that the reported site of the massacre was about nine miles west of Brazil's unmarked Amazon border with Venezuela.

He said Brazilian police would turn over their investigation to Venezuelan authorities. He also said that new information gathered by anthropologists in the region showed that gold miners killed 18 Yanomami in two separate attacks.

Brazil's National Indian Foundation reported last week that gold miners had slaughtered 73 Yanomami in August in Haximu village, which they believed at that time to be in Brazilian territory.

In Rio, witnesses said dozens of hooded men invaded the Vigario Geral slum around midnight. They set fire to vendors' stands and burst into homes, shooting randomly.

''We were sleeping in bed and heard a noise of somebody trying the door,'' recalled Angela dos Santos Ferreira, 41, whose husband was killed.

''My husband went to see, and I heard the shots. I've been hearing them ever since. I found him on the floor, his body covered with blood.''

Bodies lay in the street Monday morning as residents blocked the slum's main street with tires and tree branches to protest the killings.

Police cars that tried to pass the barriers were pelted with stones and forced to retreat. Col. Celso Pinto of Rio's 9th state police battalion visited the shantytown and was received with chants of ''killers'' and ''justice.''

The president of the Vigario Geral residents' association, Nivaldo Ferreira de Souza, accused police of the massacre, saying it was apparently in retaliation for the murder of four colleagues in a Saturday night ambush.

A drug trafficking gang based in the shantytown was believed to have ordered Saturday's killings. Faria said the traffickers might have been responsible Monday's massacre too.

But residents blamed the police.

''Everybody knows it was the police,'' said 16-year-old Rosangela dos Lemos, who lives in the slum. ''We who live in a poor part of the city depend on the bandits for our welfare. The police here are enemies.''

''When there's a massacre, everyone blames the police,'' answered Francisco Duraes, a Rio city councilman and state police colonel. ''It's an urban war out there.''

President Itamar Franco gave the case high priority by ordering Justice Minister Mauricio Correa to follow the investigation.

Franco gave Correa similar orders following the July 23 killings of eight street children who were shot to death as they slept in the shadow of a church in downtown Rio. Four policemen were arrested as suspects.

Eight more children were killed late last week in the northeastern cities of Recife, Olinda and Salvador. Police blamed the killings on ''extermination squads,'' which human rights groups say are made up of off-duty policemen hired by local shopkeepers.