A man was arrested for attempting to rape a woman after following her on a subway platform on the Upper East Side, the NYPD announced on Sunday afternoon.

Jose Reyes was arrested Sunday afternoon for the attempted rape of a 25-year-old woman that occurred at approximately 11 a.m. on Saturday, the police department said.

In the incident, the 25-year-old woman got onto a train in which Reyes was already on, according to the NYPD's Chief of Detectives Rodney Harrison. Harrison said the man was smoking and making "weird" noises and laughing to himself. He made a masturbating motion towards the woman, so she moved in a different direction, but the man followed her.

On the platform at the 63rd Street and Lexington Avenue stop on the Upper East Side, he attacked her, pushing her to the ground and attempting to spread her legs, Harrison said.

"This heinous and horrendous act was interrupted by good Samaritans," Harrison told reporters during a briefing at police headquarters Sunday afternoon.

The woman sustained minor injuries, but declined medical attention, the police department said in a release.

The NYPD released a video of the incident on Saturday, which was provided by a witness:

MTA spokesperson Abbey Collins called the incident "disturbing and disgraceful."

"No one should ever have to experience this type of horrific attack in the transit system," said Collins, adding the transit authority had worked closely with the NYPD to find the suspect.

The department touted that the arrest was made possible through facial recognition technology from the image in the video to a mugshot from an arrest earlier this year for criminal mischief. A tipster then told cops about spotting Reyes in East Harlem, where patrol officers arrested him.

The use of facial recognition technology was at the center of a recent controversy after the NYPD appeared to match an Instagram photograph to surveillance footage of a Black Lives Matter activist. As a result, dozens of officers, police dogs, and two police helicopters were deployed to arrest the man for allegedly yelling into an officer's ear with a megaphone during a protest.