The Dallas man who was slain after taking the stand in killer cop Amber Guyger’s trial attempted to evade testifying by fleeing the state out of fear for his life, a lawyer claimed on Tuesday.

Joshua Brown was gunned down Friday outside his Dallas apartment — just 10 days after providing key testimony about the night of neighbor Botham Jean’s murder, according to police.

Lee Merritt, who represents the Jean family, said Brown repeatedly expressed concerns that testifying would put his life at risk.

The roofing contractor had previously survived a shooting in November 2018 and the suspect remained at large.

“Josh was concerned that these people still meant him harm so when he was subpoenaed to testify against Amber Guyger he was conflicted,” Merritt wrote on Facebook. “He wanted to do the right thing.”

Merritt said prosecutors pressured him, saying his testimony would help secure a conviction in Jean’s murder.

“He, in turn, told prosecutors and the Court about the danger he felt was associated with him testifying in a public trial,” Merritt wrote, adding that Brown ultimately decided that “it was just too dangerous.”

Brown fled the state for California, where he remained as the trial got underway, according to Merritt.

But prosecutors “hounded him” and threatened to issue a warrant for his arrest if he didn’t appear in court. “So he got on a plane and came straight from the airport to the courthouse,” Merritt said.

Once he arrived, Brown met with the judge in her chambers about his concerns, but ultimately ended up taking the stand, Merritt said.

The attorney is now questioning why measures weren’t taken to protect Brown during his testimony.

“They took steps to cut off cameras and instruct media not to report on an undercover cop that testified in Guyger’s trial,” Merritt said. “Why weren’t the same measures taken to protect Joshua Brown?”

Merritt said Brown’s testimony was “powerful but it was also duplicative.”

“Nothing he testified to couldn’t have been brought in by other witnesses. It wasn’t worth his life,” he wrote.

No suspects or motive have been identified in Brown’s murder, authorities said.

Guyger, 31, was convicted last week in the murder and sentenced to 10 years in prison.