Police have arrested the man who sucker-punched a beachgoer on a Brooklyn boardwalk and left him for dead, authorities said Wednesday.

Kyle Gulino, 22, was charged with assault and manslaughter for the July 9 attack on 52-year-old Dimitry Goldfarb — who told cops before he died that he didn’t know why the man had slugged him, police said.

“It was a complete stranger to him,” a source told The Post at the time. “He didn’t know who he was. Did not know why he was assaulted.”

Goldfarb was found lying on the Riegelmann Boardwalk in Brighton Beach with head trauma and a broken right orbital bone, officials and sources said.

The Brooklyn man was rushed to NYU Langone Hospital-Brooklyn and later transferred to Bellevue Medical Center, where he was pronounced dead a day later — but not before speaking to cops about the bizarre beating.

Investigators later released surveillance footage of a shirtless man, now believed to be Gulino, leaving the scene alongside a woman in a red top.

Police nabbed Gulino on Tuesday after a witness came forward and provided a description of the attacker, which led to a canvass of the neighborhood, authorities said.

The two are believed to have gotten into an argument on the boardwalk, though it was not known what the fight was about, cops said.