A Chicago police officer who was partnered with Jason Van Dyke - who is on trial for the shooting death of 17-year-old Laquan McDonald in 2014, has testified he believed Mr McDonald posed a "threat" while he was on the ground,

Former officer Joseph Walsh was on the scene the night Mr Van Dyke, who is white, fatally shot the black teenager on a road in Chicago.

Mr Walsh testified under a grant of immunity. He is among three officers indicted on charges of conspiracy, obstruction of justice and official misconduct for allegedly conspiring to cover up facts of the shooting for fellow officer Mr Van Dyke.

Mr Walsh retired from the Chicago Police Department after the city’s inspector general recommended his dismissal for his role in the investigation.

Prosecutors called Mr Walsh to the stand Tuesday morning. According to the Sun-Times, Mr Walsh testified that he believed Mr McDonald posed a threat as he appeared to be walking towards fast food restaurants the night he was fatally shot.

He confirmed that he drew his gun, but he said he did not fire even though he believed Mr McDonald posed a threat while he was on the ground.

Prosecutor Joseph Cullen: “Did you find Laquan McDonald to be a danger at any point?”

Joe Walsh: “Yes. I assessed the entire incident when he was on the ground. He was a threat, still armed...with a knife in his hand..still moving."

“I was confident Officer Van Dyke took necessary action to save himself and myself,” he said.

Police dashcam video shows Mr McDonald carrying a small knife on 20 October but walking away as Mr Van Dyke can be seen firing at the 17-year-old. Mr McDonald was shot 16 times.

Mr Van Dyke was charged on six counts of first-degree murder, one count of official misconduct and 16 counts of aggravated battery with a firearm. His attorneys allege he feared for his life when he shot Mr McDonald multiple times.

“I reasonably believed he was going to enter into that Burger King,” Mr Walsh said.. “He was armed with a knife. I did not want him to make entry into that Burger King that had people in there.”

Mr Walsh also noted that when Mr McDonald allegedly walked passed the Burger King, he “reasonably believed” then he was headed for Dunkin’ Donuts.

Video of Laquan McDonald Shooting Causes Huge Protests in Chicago

Mr Walsh testified that when he stopped the car as they approached Mr McDonald on the street,he told Mr Van Dyke to remain in the vehicle.

“I told him not to get out because Laquan McDonald was too close,” he said according to the Chicago Tribune.

During his testimony, Mr Walsh alleged that Mr McDonald raised his knife to shoulder height and swung it prior to the shooting. When pressed that the video does not show that action he insisted his “angle was totally different” than that of the position of the video, the Tribune reported.

On the night of the shooting, Mr Van Dyke had continued to fire at Mr McDonald as he lay on the ground. Mr Walsh contended that Mr McDonald still posed a threat after he was shot and fell to the street.

Mr Van Dyke was the only officer at the scene who fired his gun. When prosecutors asked Mr Walsh during the trial why did not shoot Mr McDonald he responded, “I could have”.

Two patrol officers who had trailed Mr McDonald for more than half a mile prior to his shooting on Pulaski road testified on Monday. Officer Joseph McElligott told jurors that Mr McDonald did not make any "direct movements" at him and that he felt he and his partner were "protected for the most part". He added that they were trailing him and "trying to buy time to have a Taser". Prosecutors asked Chicago police officer Dora Fontaine if Mr McDonald had raised his arm "as if he was attempting to stab anyone" to which Ms Fontaine responded "no".

Black Lives Matter organises march to Trump Tower Show all 15 1 /15 Black Lives Matter organises march to Trump Tower Black Lives Matter organises march to Trump Tower Kandy Freeman participates in a Black Lives Matter protest in front of Trump Tower in New York City, U.S. January 14, 2017. Stephanie Keith/Reuters Black Lives Matter organises march to Trump Tower People participate in a Black Lives Matter protest in front of Trump Tower in New York City, U.S. January 14, 2017. Stephanie Keith/Reuters Black Lives Matter organises march to Trump Tower Hawk Newsome, a Black Lives Matter activist, leads a protest outside Trump Tower in New York City on January 14, 2017. Dominick Reuter/AFP/Getty Images Black Lives Matter organises march to Trump Tower Hawk Newsome (C) leads a chant during a Black Lives Matter protest in front of Trump Tower in New York City, US. January 14, 2017. Dominick Reuter/AFP/Getty Images Black Lives Matter organises march to Trump Tower People participate in a Black Lives Matter protest in front of Trump Tower in New York City, U.S. January 14, 2017. Stephanie Keith/Reuters Black Lives Matter organises march to Trump Tower An NYPD officer speaks with a Black Lives Matter leaders during a protest in the snow outside Trump Tower in New York City on January 14, 2017. Dominick Reuter/AFP/Getty Images Black Lives Matter organises march to Trump Tower Kandy Freeman participates in a Black Lives Matter protest in front of Trump Tower in New York City, U.S. January 14, 2017. Stephanie Keith/Reuters Black Lives Matter organises march to Trump Tower An NYPD officer speaks with a Black Lives Matter leaders during a protest in the snow outside Trump Tower in New York City on January 14, 2017. Dominick Reuter/AFP/Getty Images Black Lives Matter organises march to Trump Tower Carol Garza, a Black Lives Matter supporter, protests outside Trump Tower in New York City on January 14, 2017. Dominick Reuter/AFP/Getty Images Black Lives Matter organises march to Trump Tower People participate in a Black Lives Matter protest in front of Trump Tower in New York City, U.S. January 14, 2017. Stephanie Keith/Reuters Black Lives Matter organises march to Trump Tower A Black Lives Matter supporter protests in the snow outside Trump Tower in New York City on January 14, 2017. Dominick Reuter/AFP/Getty Images Black Lives Matter organises march to Trump Tower Black Lives Matter activists march in front of Trump Tower on January 14, 2017 in New York City. Kevin Hagen/Getty Black Lives Matter organises march to Trump Tower Black Lives Matter activists march in front of Trump Tower on January 14, 2017 in New York City. Kevin Hagen/Getty Black Lives Matter organises march to Trump Tower Black Lives Matter supporters protest in the snow outside Trump Tower in New York City on January 14, 2017. Dominick Reuter/AFP/Getty Images Black Lives Matter organises march to Trump Tower Black Lives Matter Kandy Freeman marches in front of Trump Tower on January 14, 2017 in New York City. Kevin Hagen/Getty

Xavier Torress, a witness to the shooting, also took the stand on Tuesday morning. He told jurors he saw Mr McDonald walking towards a nearby fence when he heard gunshots, and that the 17-year-old “looked like he was trying to get away from the officers”.

Mr McDonald’s shooting has further highlighted the racial tensions between the black community and the police in the US, and the disparities in the way police departments use force.

And race continues to play a key role in the case; attorneys on both sides, for instance, have accused one another of excluding potential jurors on the basis of race.