Around 200 people were trapped at the top of a popular Rio de Janeiro tourist spot during a police operation in the Vidigal favela of the city, according to local media.

The trail leading to the top of Morro Dois Irmãos, popular for its views over Ipanema Beach, begins east of the neighbourhood.

Officers from the Public Prosecutor's Office of Bahia and Rio's Polícia Civil were seeking to arrest alleged members of the Comando Vermelho gang they believed to be hiding in Vidigal, broadcaster TV Globo reported.

The main access route to the trail was blocked as the officers and suspected gang members exchanged fire, leaving the alarmed tourists stranded.

Video shared on social media shows the group sitting on the ground as the sun rises - a police helicopter flies overhead and shooting can be heard in the distance.

Portuguese tourist Matilda Oliveiro was waiting to see the sunrise from the top of Morro Dois Irmãos with her sister Rita when the guides told everyone to sit down.

We had waited for sunrise and, suddenly, the guides asked us to sit down and we started hearing gunshots, she told TV Globo.

They did their job. It's always scary, but it was controlled as much as possible. We passed the police on the way, and the situation was already under control.

The stranded group were able to descend after about 30 minutes, according to local media.

The guides had been informed about the operation beforehand, according to Rita Oliveiro. Other local guides told TV Globo they had coordinated with police units operating in Vidigal.

Despite the initial panic, Danielly Nobre, another tourist, reassured, In the end, everything worked out. Everyone went down in a single file, everyone helping, and we managed to finish the trail, see the sunrise, and experience that adrenaline rush, she said.

Comando Vermelho and groups like it enforce strict rules in the areas they control, moving beyond just drug sales to monopolizing services like gas, cable television, and transport.