An Alabama judge who once complained on Facebook of being racially profiled by the police refused on Thursday to recuse himself in a case involving a white police officer’s fatal shooting of a black man.

Defense lawyers had argued that two posts by the judge, Greg Griffin of the Montgomery County Circuit Court, created the appearance of a conflict, one of the lawyers, Roianne Conner, said in a phone interview.

But Judge Griffin denied the defense’s motion during a hearing on Thursday morning, Ms. Conner said.

“He took it very personally,” she said. “He told me he could take off his black robe, but he couldn’t take off his black skin.”