Six security officers at New York’s John F. Kennedy Airport landed in hospital after being hit by pepper spray — fired by one of their own.

The Transportation Security Administration agents, responsible for X-ray machines and other vital screening around the US transport network, suffered the friendly spray incident Tuesday after coming across “an abandoned item,” a TSA spokesman said.

They were attempting to “determine its contents and to move it out of harm’s way when it accidentally discharged,” the spokesman told AFP.

“Out of an abundance of caution, six TSA officers at JFK Airport were transported to a local hospital.”

The TSA said travelers did not get hit by the spray, which causes a painful burning sensation and is popular among police forces and for civilian self-defense.

It was not clear where the abandoned container had come from. US airports only allow such sprays to be carried in checked luggage.

According to a report in the New York Post, quoting an unnamed source, an agent was “playing around” with what he and other agents thought was just a laser pointer when it suddenly emitted spray.

The TSA has suffered a series of embarrassing recent news reports, ranging from failure at Newark International Airport to detect a fake bomb carried by an undercover government agent, to complaints of overzealous searches.