A Kansas police chief apologized Wednesday after one of his officers made up a story about being given a McDonald's coffee cup with an anti-cop slur written on it that caused an uproar over social media.

Herington Police Chief Brian Hornaday said he is “truly sorry for all unnecessary, negative attention and pain that this incident has brought to every person who was affected" in a news release.

SUPER-FRIENDLY CHICK-FIL-A EMPLOYEE IN NORTH CAROLINA CHARMS INTERNET IN VIRAL VID: HE'S 'LIKE THIS ALL THE TIME'

The apology came days after Hornaday announced that his now-former officer "completely and solely fabricated" a story that he was given a coffee cup with "f------g pig" written on it at a McDonald's in Junction City.

The officer, an Army veteran who had been on the job two months, said it was meant to be a joke. He resigned over the incident.

The story made the rounds on social media and ignited nationwide criticism of McDonald's. The owner of the fast-food location denied his employees wrote the vulgar phrase and said security video prove they committed no wrongdoing.

CLICK HERE TO GET THE FOX NEWS APP

Hornaday confirmed the restaurant's account during a Tuesday news conference, calling the incident a "black eye for law enforcement"

“We hope that this is always remembered as the act of one person and not that of the chosen few men and women who have the courage to boldly protect and serve the citizens of this great nation,” he said.