A white Alabama police officer was caught on a secret recording discussing ways to kill a black man and cover it up, it was revealed Tuesday.

The 2013 incident was quietly settled out of court and ended with the officer keeping his job, according to legal documents and interviews with lawyers and officials involved in the case.

The recording, first reported by the Guardian and obtained by NBC News, captures Alexander City Officer Troy Middlebrooks during a May 2013 visit to a home where the suspect, Vincent Bias, was visiting relatives.

At one point, the officer pulls Bias' brother-in-law — who is white — aside and tells him he doesn't trust Bias. Middlebrooks had arrested Bias on drug charges weeks earlier, and seemed to be frustrated that he had made bail.

Middlebrooks tells Bias' brother-in-law, that if he were the suspect's relative, he would "f---ing kill that motherf------" and then arrange the crime scene to "make it look like he was trying to f---ing kill me."

Read More