The thriller with the 17 hostages held by a gunman on a bus in Rio de Janeiro, Brazil, had a happy ending: after about three hours, the attacker surrendered to the police.

“He has surrendered, he has been arrested, all the hostages have been released and are safe,” Marco Andrade, head of special police forces who had surrounded the intercity bus station, told reporters.

The passengers held hostage by the gunman, including children and the elderly, are safe and sound. However, two people were shot earlier by the attacker, “outside the bus”. A 34-year-old man, who was shot three times in the chest and abdomen, is in critical condition and underwent emergency surgery. The second victim is out of danger.

Rio de Janeiro state governor Claudio Castro praised security forces for their handling of the crisis. “Exemplary action by the security forces of Rio de Janeiro,” he wrote in a post on the X platform (formerly Twitter).

The hostage-taking began around 15:00 (local time, 21:00 Greek time) at a central Rio station from where buses depart for other Brazilian states. The vehicle remained immobilized at the station and the area was cordoned off by special police forces.

The police operation was broadcast online by television networks. The GloboNews channel showed images of freed hostages running out of the bus in terror, including a young mother holding her baby.

In another snapshot, the perpetrator can be seen being driven into a police van.

The motive remains unclear so far.