No one was injured in the incident. The equestrian venue is sited next to a military complex, though police are still trying to discover who fired the bullet and from where, a spokesman for the Rio 2016 organising committee said.
"It was a stray bullet and has nothing to do with the Games," Mario Andrada said at a news conference, adding that security around the venue had been increased as a precaution.
According to New Zealand's Chef de Mission Rob Waddell, the team's press attache had been working in the tent at the Deodoro equestrian event centre, when the bullet came flying through the roof and landed just two metres from her.
"We understand she is OK," Mr Waddell said. "Fortunately we had (New Zealand Olympic staff) with her at the time and they immediately went and sat in a building with a concrete structure to remain safe.
"We took the situation very seriously and put our security into play."
Dozens of police and troops patrolled the streets en route to the equestrian complex. The area was not evacuated.
Some of the world's most expensive animals are housed nearby, and riders were competing in the dressage phase of the eventing competition just a few meters away.
Security is a main concern of organizers of South America's first Olympics. Brazil has deployed 85,000 police, military, and private security personnel for the Olympics, more than double that of London in 2012.
Also on Saturday a bomb squad detonated an unattended backpack near the end of the cycling course.

