A Florida police detective said he was "only joking" last month when he told a fellow officer there would be an "active shooter situation" at police headquarters if he did not receive an assignment he wanted.

>> Read more trending news 

The officer said the Aug. 5 comment "made the hairs on the back of his neck stand up."

Now, detective Steve Bergren of the Tarpon Springs Police Department is without a job as he resigned Thursday before police Chief Robert Kochen could fire him, the Tampa Bay Times reported.

Bergren, an 11-year veteran of the police department, wrote a letter to the police chief to say he was only joking, the newspaper reported.

"In his letter he says it was in jest, but in hindsight it was ill-advised," Tarpon Springs Police Maj. Jeffrey Young told the Times. "In today's society you just can't say something like that and not be held accountable for it."

In his letter, Bergren apologized for his comment.

“During the course of this conversation, I made a statement in jest referencing an active shooter,” Bergren wrote. “I never imagined when the statement was made that it would be perceived ... as a potential threat to our shared workplace."

Bergren also wrote his 'attempt at humor" was ill-advised.

“Read read“I failed to appreciate how recent tragic events could lead to a statement referencing an active shooter being misperceived,” he wrote,

The name of the detective who heard Bergren's comment was not released by police officials. In a release, police officials said the officer did not believe Bergren was joking.

"The other detective said Bergren made this statement in a stoic manner and not giving any indication that this was a joke," officials told the Times.

The internal investigation will be sent to the Florida Department of Law Enforcement’s Standards Commission.

Bergren could not be reached for comment Friday, the Times reported. His attorney with the Sun Coast Police Benevolent Association did not return a request for comment.