TARPON SPRINGS ― Detective Steve Bergren was talking to a fellow Tarpon Springs detective about how much he coveted an assignment last month when he made this comment:

He said there would be an “active shooter situation" at Tarpon Springs Police Department headquarters if he didn’t get the position, according to the agency.

“The detective said it was something that made the hairs on the back of his neck stand up,” said Tarpon Springs Police Maj. Jeffrey Young.

RELATED STORY: Pinellas deputy purposefully crashes into car to stop more damage

Bergren wrote to the police chief to say he was just joking. He resigned Thursday before Tarpon Springs police Chief Robert Kochen could fire him for breaking city rules.

Young said law enforcement cannot ask the public to watch out for “red flags” ― signs of potentially dangerous behavior ― and ignore such a sign under its own roof.

“In his letter he says it was in jest, but in hindsight it was ill-advised," Young said. “In today’s society you just can’t say something like that and not be held accountable for it.”

RELATED STORY: Dog toy photo leads to police investigation

Bergren resigned Thursday before his scheduled meeting with investigators. In his letter to the chief, he apologized for his behavior, writing that he considers the Tarpon Springs Police Department “an extension of my own family.” He also addressed his Aug. 5 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."

The name of the detective who heard the comment was not released by the department. But he told internal investigators that Bergren didn’t act like he was joking.

“The other detective said Bergren made this statement in a stoic manner and not giving any indication that this was a joke,” the agency said.

RELATED STORY: Pinellas school guardian pawned his gun and body armor, deputies say

Bergren was placed on paid leave the next day, and his agency-issued firearm, badge and identification were all taken from him pending the outcome of an internal investigation.

During the investigation, police said they learned that on May 10, Bergren made a similar comment to other coworkers about what would happen if the police department didn’t appoint him to the Pinellas County Sheriff’s Office’s county-wide drug task force. The comment was also made “in a stoic manner,” the agency said.

The coworkers in the May 10 incident didn’t take it as a threat, however.

“They thought he was just joking," Young said. "That was his personality. He is stoic and they thought he just has a dry sense of humor.”

However, the regulations governing Tarpon Springs’ police officers and city employees are clear, the agency said. The chief sustained a complaint of conduct unbecoming a police officer against Bergren. The incident would also have been considered a workplace threat under city rules, which call for the employee to be terminated.

The internal investigation will be sent to the Florida Department of Law Enforcement’s Standards Commission, which could affect Bergren’s state law enforcement officer certification.

Bergren joined the force in 2008. His personnel file includes numerous disciplinary actions. Those include a written reprimand in 2008 for missing a deposition, two more reprimands in 2015 and 2018 for vehicle crashes that were deemed his fault, and another 2018 incident in which he received “verbal counseling” for his conduct to the public. In 2012, he was cleared of an allegation that he posted racist pictures to his Facebook page.

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

In his letter, Bergren said his “attempt at humor” was “ill-advised.” He also added: “I failed to appreciate how recent tragic events could lead to a statement referencing an active shooter being misperceived.”