A key witness who testified for the prosecution in the trial of killer Texas cop Amber Guyger was shot to death in an ambush outside his apartment, according to a report on Saturday.

Witness Joshua Brown, a neighbor of Guyger’s victim Botham Jean, was found on the ground, his body riddled with bullets, Friday around 10:30 p.m. outside his building in a Dallas neighborhood, The Dallas Morning News reported.

He was taken to Parkland Memorial Hospital, where he died from his injuries. There was no suspect information available.

Witnesses told police they heard several gunshots and saw a silver sedan speeding away from the parking lot.

Brown 28, testified last week about the night of Sept. 6, 2018, when Guyger, now a former Dallas Police officer, entered Jean’s apartment thinking it was hers and shot him dead, believing he was an intruder.

Brown said he heard what sounded like “two people meeting by surprise” and then two gunshots.

He wept on the stand as he recounted hearing Jean, his 26-year-old next-door neighbor, singing gospel music and Drake through the door.

Dallas County prosecutor Jason Hermus, the lead prosecutor in the Guyger case, applauded Brown’s decision to come forward.

“He bravely came forward to testify when others wouldn’t, ” Hermus said Saturday. “If we had more people like him, we would have a better world.”

Civil rights attorney Lee Merritt, who is representing the Jean family, said Brown was a former athlete turned entrepreneur whose slaying “underscores the reality of the black experience in America.”

“Brown lived in constant fear that he could be the next victim of gun violence,” Merritt wrote on Facebook. “Brown deserves the same justice he sought to ensure the Jean family.”

Guyger, 31, was sentenced to 10 years in prison on Wednesday.