A good Samaritan who noticed a man putting his cellphone under a woman's skirt to take a photograph helped facilitate the arrest of an off-duty firefighter, according to police.

Gary Pandolfino, 46, was arrested on Thursday and charged with unlawful surveillance for the incident which took place at the 59th Street-Lexington Avenue subway station. A police spokesperson said that the witness saw the man take an upskirt picture while on an escalator, and then confronted him.

The suspect fled, but the witness followed him, spotting him "disposing of the phone" in a trash can or gutter, the spokesperson said, but the witness retrieved the phone and presented it to police.

A few years ago, the Manhattan D.A's.office announced a crackdown on upskirt perverts, and D.A. Cy Vance said, "This is a serious crime with serious consequences. If convicted of Unlawful Surveillance, offenders face up to four years in prison, and possible sex offender registration. I urge New Yorkers to stay aware, and most of all, to report this behavior to law enforcement — either by telling a nearby police officer or calling 911. These are not victimless crimes, but damaging invasions of privacy, and so-called ‘upskirters’ will be prosecuted to the fullest extent of the law."

Update: The FDNY said that Pandolfino, a 17-year veteran of the department, is assigned to a Manhattan firehouse. He faces a suspension pending the outcome of the arraignment today.