A British police officer is under investigation after he was captured on video joking about shooting a black man.

Authorities said the officer was removed from front-line duties after West Midlands Police received a complaint about a Facebook video showing the officer making flippant racial comments during an investigation.

“You would be the first one I’d shoot if I had a gun, definitely,” the officer, whose name was not released, can be heard telling the man.

The comments were made while West Midlands police were searching a residence in Coventry, a city about 100 miles northwest of London, according to a news release. In the beginning of the video, the officer can be heard asking the man why he did not open the door.

“Because I was f‑‑‑ing half-asleep. … I didn’t know who you was. … You were climbing up the window like thieves,” the man said.

The man, whose name was not released and whose face is not shown in the video, appeared to be sitting down and smoking a cigarette as three officers in bright yellow vests stood by the door. When one of them said they were police officers, the man responded, “That’s even worse,” and said he has seen “all kinds of videos.”

“You’re going to go Black Lives Matter on us, are you?” the officer said.

“Yeah!” the man exclaimed. He and the officers laughed.

That’s when the officer joked about shooting the man.

“Oh, f‑‑‑ing hell,” the man replied. A woman can be heard laughing in the background.

Assistant Chief Constable Alex Murray said Wednesday that the comments were “not right” and that the officer has apologized. It’s unclear whether he knew he was being recorded.

“We expect the highest standards of behavior from all our officers and staff, and we will always take complaints from members of the public seriously,” Murray said in a statement.

The incident occurred Aug. 24, but the video did not surface until recently. It has been viewed thousands of times since it was posted Tuesday night on Facebook.

NEWS BREAKING!!!........We been sent this video of the disgusting conduct of the notorious West Midlands Police visiting someone home talking about "Not to go Black Lives Matter on us" speaking to the black person in the room saying " You would be the first one i would shoot if i had a gun definitely" Our comrades Desmond & Charlie will have some questions for #WMP #JusticeOrElseUK Jusyice 4 Kingsley Burrell

Posted by Justice Or Else UK on Tuesday, September 12, 2017

Deb Edmonds, a spokeswoman for the police department, said the officers were at the residence as part of an investigation. She said no one was arrested, and she declined to elaborate.

The officer’s name will not be released unless there’s a criminal proceeding, Edmonds said.

The complaint was referred to the Independent Police Complaints Commission, a national agency that investigates serious complaints and allegations of misconduct against police officers. The commission will either investigate the allegations or refer it back to West Midlands Police’s Professional Standards Department, Edmonds said.

In a brief statement Wednesday, the commission said: “After careful assessment, we have decided it is suitable for local investigation by the force.”

Desmond Jaddoo, a community activist from nearby Birmingham, Britain’s second-largest city, told the Guardian newspaper that the officer should be removed from duty and that his comments only reinforce mistrust in law enforcement.

“Police officers are there to set an example. Their behavior must be beyond reproach,” Jaddoo said. “You don't make flippant statements about serious issues which affect communities. This is not locker room banter.”

Last month, a Georgia police officer said he’s retiring from the Cobb County Police Department after he was captured on camera telling a woman during a traffic stop that law enforcement officers “only kill black people.”

Dash-cam video showed Lt. Greg Abbott standing outside a vehicle during a traffic stop in July 2016. A female passenger can be heard telling the officer that she did not want to put her hands down to reach for her phone because she has seen “way too many videos of cops —.”

“But you’re not black,” the officer said, interrupting the woman. “Remember, we only kill black people. Yeah, we only kill black people, right?”