The Philadelphia Police Department admitted one of its homicide detectives is under investigation after a social media video surfaced of him using a racial slur and finishing having sex with someone in a car.

CBS Philadelphia reported that PPD Capt Sekou Kinebrew said there is “an internal investigation regarding a video that surfaced online” the week prior.

On December 21, local independent journalist Andre Boyer posted video of a the man now confirmed as a PPD homicide detective leaving a vehicle while buckling and zipping up his pants as the person recording approached him.

“What are you doing?” the detective asked before calling the person recording him a “n****r.”

Both the man recording the incident and Boyer alleged that the detective was having sex with a prostitute in his car, though PPD did not confirm this aspect of the video.

The man who recorded the video appeared to provoke the detective as he approached him, calling him a “goofball as*” and threatening to “lay you the f*ck out.”

After the detective called him the N-word, the man filming again threatened to “put [him] out.”

“You have no idea,” the detective responded. “I will f*cking kill you.”

He told the person recording to “get the f*ck out of here” — at which point the detective got punched.

The video was posted just before a major shake-up in the leadership of the PPD Homicide Unit as its captain was transferred to another department.

Watch below: