A Massachusetts man is considering legal action against police officers who repeatedly struck him with batons and shot him with beanbags in a booking room.

Joseph O’Brien had been taken into custody in April 2012 after he was found unconscious in some woods.

A video obtained by WCVB-TV shows that he was initially cooperative, but O’Brien becomes more combative as officers act aggressively toward him.

The two-hour-long video shows two Bellingham police officers strike him repeatedly with their batons and doused with pepper spray as O’Brien – who has one wrist handcuffed to a bar – swings at officers with a phone receiver.

“The police response looks like something out of the Keystone Cops,” said former Boston Police Lt. Tom Nolan. “The video should be used as a training video in any police academy to train novice police officers what not to do.”

Another officer, from Franklin, then shocks O’Brien twice with a Taser as the suspect asks why he’s been brought to the police station.

An officer tells him he’s under arrest, and O’Brien asks what charges.

“You know what — tase him,” an officer says.

Bellingham Police Sgt. Richard Perry then opens fire with nonlethal bean-bag bullets, and then police bring in a K-9 unit.

“I’ve never seen anything like this in my life,” Nolan said. “He should have been put into a holding cell within two minutes of arriving at the station and once he demonstrated that he was uncooperative.”

O’Brien, who tested positive for ketamine, eventually pleaded guilty to multiple charges, including assault and battery on a police officer, resisting arrest, and drug possession.

“There were head injuries, head trauma, facial injuries, he suffered broken ribs,” said Ed McCormick, O’Brien’s attorney. “Whether it was bad training, bad performance or ill motive, something has to explain a two-hour video of bedlam going on in the police station with one defendant.”

Bellingham Police Chief Gerry Daigle said he stands behind his officers, none of whom were disciplined.

No internal investigation was conducted, although Nolan said the incident clearly met the definition of excessive force.

“I would say if in the law enforcement dictionary, you look up excessive force, they’ll be a picture of a scene like this,” Nolan said. “This is completely over the top.”