The vice-consul is reportedly a Rio native and an expert in jiu jitsu.

Police said the vice-consul, "reacted to an attempted assault" by defending himself.

Police said the shooting took place near the Athletes’ Village in the western part of Rio.

"The vice consul got into a physical struggle with the assailant and during the fight the aggressor's weapon fired shots. The assailant died of his wounds on the spot," the Rio police homicide squad statement said.

The vice-consul was reportedly in his car with his wife and daughter when they were set upon by men on two motorbikes while caught in a traffic jam.

The second robber fled the scene. 

About 85,000 police and soldiers have been deployed to keep the peace during the Olympic Games.