A Kansas police officer resigned Monday after fabricating a story that employees at a McDonald's wrote the words "F---ing Pig" on his coffee cup.

Herington Police Chief Brian Hornaday said Saturday that one of his officers went to a McDonald's in Junction City before work and was given the cup, NBC affiliate KSNT of Topeka reported. After further investigation, the department discovered that the unidentified Herington officer made up the story.

"This was completely and solely fabricated by a Herington police officer no longer employed with the agency," Hornaday told reporters Monday.

Herington, Kansas, Police Chief Brian Hornaday said one of his officers fabricated the story that a McDonald's employee wrote 'F---ing Pig' on the side of his coffee cup. The image has been blurred by NBC News. via Facebook

Hornaday said the McDonald's employees had nothing to do with the hoax and were highly cooperative during the investigation.

The ex-officer, who remained unidentified, is a former military police officer in the Army and had been on the small town's force for two months. Hornaday said the officer told him that the incident was intended as a joke.

"I truly hope the former officer of the Herington Police Department that did this understands the magnitude of the black eye this gives the law enforcement profession from coast to coast," Hornaday said.

Hornaday could not be immediately reached for comment Monday.

Download the NBC News app for breaking news

The McDonald's in Junction City, about 25 miles north of Herington near Fort Riley Army Base, said Sunday that after reviewing surveillance video, representatives were confident that was no employee wrote the message.

"My McDonald's have the utmost respect for all members of law enforcement and the military and were troubled by the accusation made," Dana Cook, the owner of the franchise, said in a statement to KSNT on Sunday evening.

"We thoroughly reviewed our security video from every angle, which clearly shows the words were not written by one of our employees," Cook said.