Rio de Janeiro - A police officer was shot in the head after he and two others working security at the Rio de Janeiro Olympics got lost near a slum and encountered gunfire.The officers from Brazil's national security force were using a GPS device to navigate unfamiliar streets on Wednesday afternoon when they took a wrong turn off a highway leading to Rio's international airport. Their truck was sprayed with bullets, and officer Helio Vieira was shot. The Justice Ministry said Vieira was recovering after a four-hour surgery, and was in stable condition. The other officers suffered minor injuries when the windows of their vehicle shattered.Dozens of heavily armed commandos could be seen on Thursday frisking residents and going house to house in the Mare complex of slums, one of Rio's most crime-ridden areas that is dominated by drug-trafficking gangs. Snipers took up positions on a nearby highway, as a low-flying police helicopter circled overhead.Justice Minister Alexandre de Moraes said two suspects had been identified but were not yet in custody. He denounced what he called a "cowardly attack".Flying bulletsThe incident was the bloodiest of several that have marred the start of South America's first Olympic Games.On Tuesday, two windows were shattered on a bus carrying journalists from an Olympic venue in the impoverished Deodoro district. Rio organisers said the bus was hit by a rock, even though one passenger, who identified herself as a former American military officer, believed the cause to be gunfire. There were no serious injuries.The equestrian venue in Deodoro has had two brushes with stray gunfire since the games started. A bullet flew through the roof of a media tent there on Saturday; officials said it had been fired from a hillside slum, and that the intended target was probably a security camera on a blimp. A second bullet hit on Wednesday near the stables. Officials were adding more security at the venue.Muggings have also been reported among Olympic athletes, officials and journalists.Pervasive violence is an everyday part of life in Rio. After declines in past years, homicides have spiked again as Brazil's worst recession in decades fuels violence and forces budget cuts. The number of homicides in the first five months of 2016 increased by 18% to 1 870 in greater Rio.Police killings are also on the rise, with the vast majority of victims black residents of impoverished slums that are fiefdoms of the city's many criminal gangs.More than 85 000 security forces - double the number present in London in 2012 - have been deployed to the city to keep thousands of Olympic athletes and an estimated 500 000 tourists safe.