This was necessary roughness.

Former NFL player Tony Beckham made the tackle of his life in Florida this week — clobbering an intruder who was allegedly masturbating outside his 15-year-old daughter’s window, a report said.

Beckham — a defensive player for the Tennessee Titans and the Detroit Lions in 2002-05 — was inside his Palm Beach County home just before dawn Monday and heard a noise.

“I waited for a second and I looked again,” Beckham told the ABC affiliate in West Palm Beach.

“And I see a white male and he’s standing by my window and he’s trying to get a better position.”

The man was peeping into Beckham’s teen daughter’s room, his pants were partly down and he was masturbating, Beckham told the station.

“I couldn’t believe it. I was like, ‘Is this for real?’” he told the station. “I thought I was getting ‘Punk’d.’”

Beckham said he yelled at the man, who then tried to run.

But Beckham said he gave chase, and “had a good conversation” with the alleged creep, while Beckham’s wife, Amanda, called the cops.

That “conversation” left alleged perv Geoffrey Cassidy with a black eye and multiple broken facial bones, as demonstrated by his mug shot.

Cassidy has been charged with lewd and lascivious behavior with a victim younger than 16 years old, the station reported. He was being held in Palm Beach County Jail in lieu of $1,500 bail.

After four years with the Titans, Beckham played backup safety and cornerback during his single season with the Lions in 2005, according to the team’s archived website.