A white US police officer who killed an unarmed African American man two years ago says he probably fired twelve shots at him.

"He was going to attack me. He was going to assault me. He was going to take my gun from me," Randall Kerrick said on Thursday as he took the witness stand on Thursday in his trial.

Kerrick is facing voluntary manslaughter charges in the shooting death of Jonathan Ferrell. The emotional Charlotte-Mecklenburg will continue his testimony on Friday when the trial resumes.

In a nearly packed courtroom, Kerrick re-created his versions of the events that took place on September 14, 2013. He repeated warnings he said he gave to former Florida A&M football player Ferrell. He yelled, "Stop!" and "Get on the ground!"

Kerrick told the judges that he thought his gun wasn't functioning properly because the strong black man kept coming at him and he kept firing at him.

"I thought I was going to die because I could do nothing that would stop him," Kerrick said.

Kerrick said he thought he fired four to six times bullets at him, but said he now knows he fired at least 12 bullets.

Ferrell's shooting death took place almost a year before an unarmed African American in New York and an unarmed black teenager in Ferguson, Missouri, were shot dead by white police officers.

Widespread demonstrations erupted after Michael Brown's death in Ferguson and a grand jury's failure to indict officer Darren Wilson.

This week, protesters again hit the streets to mark the first death anniversary of Brown. Police used force against demonstrators and arrested dozens of them.

Demonstrators march during a Michael Brown memorial protest in Brooklyn, New York on August 9, 2015. (AFP photo)

Many US cities have been the scene of protests during the past several months over fatal shootings of African Americans by police and their brutal treatment of Americans, particularly people of color.

A new report has indicated that police in the US have shot dead more than 600 people across the country so far this year.

The Washington Post data shows 601 people were shot dead by police officers in the first eight months of 2015.

During the past 30 days, at least 85 people were killed by police, the report said, adding 24 of the victims were black and unarmed.