QUEENS — A longtime New York City substitute teacher is in hot water after telling students he “would shoot them” if they didn’t do as they were told, according to the NYPD.

The 52-year-old Department of Education employee was arrested Wednesday evening in Queens on a charge of making a terroristic threat, police said.

According to authorities, the educator told police he only meant it as a joke.

“This deeply disturbing allegation is absolutely unacceptable,” the Department of Education said in a statement Thursday. “This substitute teacher was immediately suspended.”

DOE sources said the man had been a substitute teacher for nearly 20 year and has no prior disciplinary history.

It was not clear what grade the students were in or at which school the incident took place.