Security forces carried out large-scale training exercises for the Rio 2016 Olympic Games over the weekend as the host city gears up to host the world next month.

A simulation of how to deal with a terrorist threat was undertaken in Deodoro, where the second largest venue cluster is based, on Friday and Saturday. Sunday saw a full rehearsal of the security plan for the opening ceremony, which will take place at the Maracanã Stadium on 5 August.

About 1,000 security personnel from more than 20 different institutions, including Rio’s special operations police (BOPE), the army and the fire brigade, took part in the operations on Friday and Saturday, which included a simulated response to a bomb threat at Deodoro station. As well as negotiations that ended with police storming the carriage where ‘terrorists’ were holding ‘hostages’, the simulation also saw a robot defuse a ‘bomb’ retrieved from a backpack.

Security personnel from 55 countries have been helping Brazilian forces prepare and Cristiano Sampaio, regional security coordinator, said: “We’re exchanging experiences with various countries, all of which will be reflected here in Rio de Janeiro. This exercise had been previously planned, though with the recent happenings in Nice we are ever more alert.”

On Sunday, the focus switched to the Maracanã. Beginning at 5am, about 2,000 security personnel located at various points across the city simulated the transportation of athletes and Games workers to the venue for the opening ceremony.

Felipe Seixas, director of special projects and coordinator of the simulation, said: “There were no unexpected problems, from the arrival at the Palácio of Itamaraty (Foreign Office building), to Maracanã and the return leg. We are confident that now we’re ready for the opening ceremony and to transport athletes and authorities.”