A judge has defended her conduct after she hugged a white former Dallas police officer who shot dead her black neighbour, and also gave her a Bible.

Judge Tammy Kemp embraced Amber Guyger, 31, at the conclusion of a trial in which Guyger was sentenced to 10 years in prison for killing Botham Jean, 26, after entering his apartment in September 2018.

Jean was black. Guyger, who is white, put her arms out to hug Kemp after the judge handed her a Bible to read in prison.

Kemp, who is black, said what she did was appropriate because the trial had ended.

She told the Associated Press: “I came down to extend my condolences to the Jean family and to encourage Ms Guyger, because she has a lot of life to live.”

Kemp said: “She asked me if I thought that God could forgive her and I said, ‘Yes, God can forgive you and has.’ If she wanted to start with the Bible, I didn’t want her to go back to the jail and to sink into doubt and self-pity and become bitter. Because she still has a lot of life ahead of her following her sentence and I would hope that she could live it purposefully.”

The embrace sparked fierce criticism. A secular group, the Freedom From Religion Foundation, filed a complaint with Texas authorities over what it argues is judicial misconduct.

The complaint alleges Kemp committed an “egregious abuse of power” by displaying her religious beliefs while carrying out her duties.

Kemp rejected that argument. She said: “I could not refuse that woman a hug.”

She added: “And I don’t understand the anger. And I guess I could say if you profess religious beliefs and you are going to follow them, I would hope that they not be situational and limited to one race only.”

The judge was not the only person to hug Guyger in court. Jean’s younger brother, Brandt, also hugged Guyger and told her he forgave her.

Brandt Jean said: “I’m speaking for myself, not my family, but I love you just like anyone else.”

Jean’s father, Bertrum, has said he also forgives Guyger, though he said her sentence should have been longer. Prosecutors sought 28 years, the age Botham Jean would have been now had he lived.

Guyger lived one floor below Jean and said she entered his apartment thinking it was hers. She shot him because she said she thought he was a burglar. Jean was sitting watching TV and eating ice cream when he was killed.

Criminal justice groups expressed relief at the relatively rare sight of a white police officer being convicted for killing an unarmed black man. But some have criticized the outpouring of forgiveness towards Guyger.

The trauma of the case has been exacerbated by the killing of a witness who gave evidence during the trial.

Joshua Brown, who lived in the same apartment complex and testified he heard two people talking followed by gunfire, was himself shot dead in Dallas on Friday.

On Tuesday, Dallas police said three men suspected in the killing were from Alexandria, Louisiana and would face capital murder charges.

Assistant police chief Avery Moore said the three were in Dallas to buy drugs from Brown and the killing was not tied in any way to Brown testifying at the Guyger trial.