JUNCTION CITY, KAN. -- A Kansas police officer has resigned after he admitted to making up a story that a McDonald's employee wrote an expletive and the word "pig" on a coffee cup, the police chief announced Monday.

Herington Police Chief Brian Hornaday said at a news conference that the now-former officer "completely and solely fabricated" the allegations. Hornaday said the officer told him the incident was "meant to be a joke."

Hornaday did not name the 23-year-old officer, but said he had been with the department about two months after spending approximately five years in the Army.

The police chief also "applauded" McDonald's for conducting its own investigation and for co-operating in the department's.

It's "absolutely a black eye on law enforcement," Hornaday said, also calling the incident an "obvious violation" of the public's trust.

Earlier Monday, the McDonald's in Junction City disputed the allegations made by the officer, who had said he received the cup with the expletive written on it as he stopped there on his way to work.

Dana Cook, the owner of the McDonald's, said in a written statement that the restaurant has security video that proves none of its employees wrote the words.

In Hornaday's initial Facebook post, he said one of his officers was handed the cup Saturday when he went through the McDonald's drive-thru.

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

He didn't immediately return an email message Monday from The Associated Press.

But he told WIBW-TV that his reaction after the initial report was based on believing that a police officer has integrity "and it would be foolish of any law enforcement agency or professional to not take the word of their police officer until they can be proven otherwise."

Hornaday said Monday he had spoken with the local prosecutor and that criminal charges against the officer were not warranted at this time.

Correction:

This story has been updated to correct the spelling of the town's name to Herington instead of Herrington.