A Kansas police chief has apologized for a former officer who concocted a story about being targeted by a slur at a local McDonald's. 

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

The apology comes after Hornaday announced Monday that the viral story was "fabricated" by a police officer, who no longer works for the department. The officer alleged that he was handed the coffee cup with the expletive at a McDonald's drive-thru. Hornaday said then that the officer told him the incident was "meant to be a joke" and resigned.

In his statement, Hornaday apologized to McDonald's and all the company's employees worldwide, and "specifically those who work at the two Junction City locations." He also apologized to Junction City residents and law enforcement nationwide.

"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."

A hoax meant as a "joke"

The alleged incident gained national attention after Hornaday said in a Facebook post, which has since been removed, that one of his officers was handed the cup at a McDonald's drive through in Junction City. The officer originally claimed he had been given a coffee cup in a drive-thru that had "f***ing pig" written on it.

Hornaday posted a picture of the cup and wrote that the officer was offered a "free lunch" but "A Big Mac and large fries doesn't make up for it. 

"This behavior has been, is and always will be wrong," Hornaday said in the post.

But the story quickly unraveled. The owner of the McDonald's said the restaurant has security video that proves none of its employees wrote the words. Hornaday held a press conference on Monday exonerating the store.

"We found that McDonald's and its employees did not have anything whatsoever to do with this incident. This was completely and solely fabricated by a Herington police officer who is no longer employed with our agency," Hornaday said then.

After the discovery, Hornaday said he would be more careful with how he uses social media in the future.

"I sincerely hope it doesn't ever happen again, but I assure you that I assure you that I will often question my decision about posting anything on social media because of the impact that it could have, mostly because everything we do, everything we say in the public eye is always brought into question," he said.  

The 23-year-old officer, who has not been identified, was with the Herington Police Department for only two months, Hornaday said. He added that his investigation concluded the accusation "was meant to be a joke," and said the officer "should have come forward immediately ... prior to this becoming a nationwide incident."

"This is absolutely a black eye on law enforcement," Hornaday said. "I hope [the former officer] understands the magnitude of the black eye that this gives the law enforcement profession from coast to coast. None of us can be excluded from that."

Dana Cook, the owner of a McDonald's in Junction City, Kansas, said in a written statement after the allegation was made that the store had video showing it couldn't have been an employee. Cook did not speculate at the time about who may have written the words. 

"My McDonald's have the utmost respect for all members of law enforcement and the military and were troubled by the accusation made," Cook wrote in the statement. "We thoroughly reviewed our security video from every angle, which clearly shows the words were not written by one of our employees. We look forward to working with Chief Hornaday as he continues his investigation."  

Other restaurant chains have also attracted scrutiny over claims that police officers were mistreated. Earlier this month, Starbucks apologized after two police officers in Riverside, California, were allegedly refused service at one of its cafes. In November, Starbucks also apologized after a server in Glenpool, Oklahoma, allegedly wrote "PIG" on a police officer's cups.