The Prince George’s County police chief apologized in a video this week after an officer made a comment to a group of children Friday about a “black bad guy” in explaining how the K-9 unit at the department operates.

Chief Hank Stawinski said in a YouTube video that he was apologizing on behalf of the officer and the department for the remark, which he called “unfortunate.”

The chief’s comments were in response to another video posted to YouTube in which an officer is heard explaining what a K-9 dog does “if a black bad guy is running and he drops his cellphone.”

In an apology that went online Monday, Stawinski said that the officer, who is a dog handler in the department’s K-9 unit, misspoke and that he had talked to the officer. Stawinski said the officer is “very troubled by the response that this has elicited in comparison to his record of service” to the community.

Stawinski went on to say: “This community doesn’t expect us to be perfect. It does expect us to acknowledge when we made a mistake, and that’s what I’m doing today.”

He continued: “On behalf of that officer and this institution I apologize to this community for that unfortunate remark. I want you to know that remark does not represent who that officer is and it does not represent what this institution stands for.”

The department has not identified the officer.

Police spokeswoman Jennifer Donelan said Wednesday that the officer was speaking at a community event attended by 75 to 100 people. His session on explaining the K-9 unit was part of several community-building activities that included a blood drive and a chance for residents and kids to talk to police officers and the chief.

Donelan said that the event was streamed live on Facebook and that no one caught the officer’s comment at the time. After the comment was noticed later, the recording was removed.

“It is accurate that he said ‘black’ but he catches himself and changes it to ‘bad guys,’ ” Donelan said. “It was a mistake. What’s heartbreaking about it is the intention of that day was to solidify relationships with the community, and it has been overshadowed by this like a black cloud.”

She added: “This is not who that officer is and this is not who we are as an agency. He did not mean to do that.”

Stawinski, whose daughter was among the children in the audience, also noted that the officer tried to correct himself.

Officials said K-9 officers often use descriptions of people when responding to real-life situations as they look for someone.

“They don’t deal in vague terminology,” Stawinski said. “When K-9s arrive [on a scene] they’re looking for someone and then there’s a description.”

Stawinski said he would look into whether the officer had gone through trainings at the department, including one on implicit bias with the University of Maryland that all officers take. He said the officer didn’t mean to be demeaning.

Still, Stawinski said he believes using the term in that scenario at the event was “not appropriate.”

“I’m taking responsibility for it and for my institution,” he said.

Stawinski said he plans to continue department-wide training that is underway and “ensure that what we [saw] doesn’t occur in an engagement with a citizen.”

He announced last year that the Justice Department was investigating the department amid complaints that it discriminated in hiring and disciplining black and Hispanic officers.