A car broke through a police blockade in the Rocinha favela at about 10:30 am (1230 GMT), police said in a statement, which added that officers “reacted” without knowing that tourists were aboard.
On later examination “the vehicle was found to be for the transport of tourists. One wounded Spanish woman was taken to the Miguel Couto hospital but died of her wounds,” the statement said.
The homicide squad identified the victim as Maria Esperanza Jimenez, 67, who was hit at least once in the neck area. An internal investigation has begun.
The shooting happened an hour after police from an elite unit fought with drug gang members in two locations in Rocinha, a favela that has long been almost beyond the control of the authorities.
The clashes left two officers and a suspected gang member hospitalized with wounds, said police, who confiscated a Glock pistol.
Hundreds of heavily armed soldiers have been deployed to help police in crackdowns on Rocinha since September after rival drug gangs battled each other, spraying bullets.
The sprawling, densely packed neighborhood of small homes sits on hills overlooking Rio's posh Leblon district.
Since last year's Olympics, security in Rio has steadily declined, particularly in the favelas where around a quarter of the city's population of 6.5 million live.
Drug gangs control much of the territory.
Despite strong warnings that tourists should stay clear of favelas, some companies continue to organize “favela tours.”
The Spanish embassy in Brasilia told AFP that it was in contact with authorities over the death of its national.
The G1 news site reported that the car's driver was an Italian tour guide who has been in Brazil for four years.
He told authorities he did not see the police barricade and was unaware of the earlier gunfire in the favela.
According to Brazilian media photos of the grey car allegedly linked to the incident, there was no sign indicating that it carried passengers.
The brother and sister-in-law of the victim, who were apparently with her in the vehicle, arrived at the hospital but made no comment to journalists.
In August a British tourist was shot and wounded after accidentally driving into a favela controlled by criminals near Rio, police said at the time.