Five Brazilian police officers have been taken into custody for allegedly altering a crime scene by placing a gun in the hand of a teenager they allegedly killed during a shootout in a Rio de Janeiro slum.

Seventeen-year-old Eduardo Felipe Santos Victor was shot to death Tuesday in the Providencia slum.

As he lay dying in a pool of blood, a slum resident videotaped one of the officers firing a handgun into the air and then putting the gun in the youth's hand. The video quickly spread on social media networks.

A Providencia resident told the Globo TV network that she saw the shooting and that the victim had tried to surrender.

"He was armed but he surrendered," she said. "After he raised his hands, they shot him."

The officers involved in the shooting registered the incident saying they acted in self-defense.

In a statement, Rio de Janeiro State Security Secretary Jose Mariano Beltrame condemned the killing and promised "exemplary punishment" for the five officers.