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 Meritt, who represents the Jean family, said that 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,” Meritt wrote on Facebook. “He wanted to do the right thing.”

Merritt said prosecutors pressured him, saying that 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,” Meritt 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 Meritt.

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, Meritt 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,” Meritt said. “Why weren’t the same measures taken to protect Joshua Brown?

Meritt said that 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.