A video of a Brazilian robber getting shot after trying to steal a motorcycle went viral on Sunday after it was published on YouTube and shared on social media sites.

A helmet-mounted camera captured the whole ordeal on Saturday, Oct. 12, in broad daylight, at the corner of the avenues Doutor Assis Ribeiro and Gabriela Mistral in Sao Paulo. The motorcyclist is seen approaching an intersection, when another motorcyclist and his passenger pull in front of him. The passenger of the other motorcycle grabs the bike’s handle and points a gun at the person filming.

The biker hands over his keys to the gunman, who then attempts to flee with the newly stolen motorcycle. However, before he is able to drive off, two pops are heard as he is shot by a policeman who got out of his hatchback car after witnessing the altercation. The bullets hit the robber in the abdomen and leg.

The robber, identified as Escarante Leonardo Santos, was taken to a nearby hospital to undergo surgery to remove the bullets, according to G1 Globo.

“Preliminary analysis of the video suggests that police action [taken] was legitimate and correct, observing the methods. At [the 59-second mark] it is possible to see the assailant pointing his weapon at the police officer,” said Sao Paulo military police in a translated statement, according to Folha De Sao Paulo.

After the video went viral on YouTube, it was taken down by the original poster because he feared retribution, according to G1 Globo. However, it was copied and reposted several times on YouTube and other social video sites after it was removed by the original user.

Take a look at the original eight-minute footage of the altercation in the video above.