A bugged-out, naked man was arrested after he was caught on camera spraying a cop with pesticide and slapping him.

A 2-minute clip of the wild encounter at Houston’s Fannin South Transit Center shows a man later identified as Keith L. Dean, 49, spraying stolen pesticide into the face of an officer — just before the naked man springs from the train and smacks the cop in the face. The officer somehow managed to keep his balance during the ordeal and Tase the man.

Dean falls to the ground, but staggers toward the officer and his partner.

“Stay down,” one cop yells as Dean tries to get back on his feet.

The officers then handcuff Dean in front of shocked commuters.

“What’s going on, buddy?” one officer asked, according to KTRK. “Can you walk, can you get up?”

Warning: Video includes graphic content

The incident — which ended with no reported injuries — happened on June 6 and the video was uploaded to YouTube two days later, but didn’t start attracting attention online until recently, according to the Houston Chronicle.

Dean’s attorney, Markay Sound, said the video speaks for itself.

“By watching the video, it is clear that there is much more going on than a man intentionally committing a crime,” Stroud told the Chronicle. “From the actions and demeanor of Mr. Dean to the professionalism shown by the officers who arrested him, it is obvious Mr. Dean is not acting rationally. I hope that once all the evidence is reviewed by the State, they will realize that Mr. Dean was not acting with malicious intent toward anyone.”

Dean remains jailed on $10,000 bail in the Harris County Jail on two counts of assault on a public servant.

Meanwhile, the Houston Police Department praised the officers for exercising restraint during the encounter.

“We commend these two officers for their actions in bringing a volatile situation to a safe conclusion,” the department said in a statement to KTRK. “The male clearly struck our officer, who in turn used sound [judgment] in holding his composure and gaining control of the scene … thanks to assistance from his partner.”

Some users on YouTube echoed that praise, saying the officers should be commended for exercising such restraint during the incident.