Screengrab of the young thief
Screengrab of the young São Paulo thief (YouTube)

A stunning YouTube video showing a São Paulo motorcyclist being robbed of his bike at gunpoint and then telling the attacker "go rob in hell, punk" after he is shot twice by an undercover policeman has gone viral on social media.

The clip, captured on a helmet camera, shows the biker riding across the streets of Brazil's second largest city on his 600cc Honda Hornet.

As he arrives at an intersection, another bike comes closer and an armed passenger with a .38 calibre revolver orders the Honda Hornet biker to jump off.

The thief, named as 18-year-old Escarante Leonardo Santos, mounts the bike in order to flee the scene but a military police officer pops up across the road and shoots him twice in the leg.

As the biker retrieves the Honda, he is overheard shouting at the thief: "Go rob in hell, you punk. My bike will take you there."

The condition of Santos, who was immediately taken to the hospital for surgery, is unknown.

São Paulo Police later released a statement about the shooting:

"Preliminary analysis of the video suggests that the action of the military police was legitimate and correct, with the observance of police techniques," it said.

"(It) clearly shows that the robber pointed his gun towards the police officer. The actions demonstrated commitment to public cause, defending society from violent criminals."

The footage was uploaded by Anderson Mangai, although it is not immediately known whether he was the victim of the foiled robbery.