The unarmed black man shot by police in a San Diego suburb had a history of run-ins with authorities and was distraught over the recent death of his best friend.

Alfred Olango was having an emotional breakdown over his friend's death when police confronted him, said attorney Dan Gilleon, who represents the Ugandan refugee's family.

Olango was shot several times after refusing to obey police commands and drawing an object from his pants pocket and pointing it at an officer in a "shooting position," police said. Officers later said the item was an electronic cigarette, or vaping, device.

Olango's sister had called 911 to say her brother was not acting like himself and was walking in traffic.

"His best friend died and he was having an emotional reaction to that," Gilleon said.

The family described Olango as a loving father who had moved back to California from Arizona and had landed a part-time job at a furniture store, Gilleon said.

The encounter was not the first time Olango was confronted by police officers and his record includes an incident in which he was illegally armed.

Olango was arrested in Colorado in 2005 after officers who pulled him over discovered 9mm semi-automatic pistol on the floor his car. He pleaded guilty in federal court and was sentenced to nearly four years for being a felon in possession of a gun.

At the time, he had previous convictions in San Diego for receiving stolen property and selling cocaine, court records show.

After being released from federal prison, he was brought into court for violating the terms of his release — the federal equivalent of probation — because of a drunken driving conviction.