Authorities in the nation's largest city have launched an investigation after officers were captured on video repeatedly kicking and hitting two men suspected of harassment Tuesday, as one official warned about a "rush to judgment."

The incident took place in New York's Washington Heights neighborhood around 2:30 p.m. after the officers had approached the men for harassing commuters at a nearby subway station, the New York Post reported.

After leaving the station, a confrontation erupted on the street between the men and the officers. It wasn't immediately clear what started the altercation.

ILLINOIS POLICE OFFICER'S SCREAMS CAUGHT ON CAMERA DURING STRUGGLE WITH FUGITIVE BEFORE BACKUP SHOOTS HIM

In video posted of the incident, the officers can be seen swinging batons at one of the men before a second man appears to charge one of the officers. A struggle then ensues on the ground before additional officers arrive.

The man who took the video, Michael Gonzlaez, told ABC7 the suspects were defying the officers and being confrontational.

"One of them actually lunged at one of the officers. He went for a tackle. That's when I pulled out my phone," he told the television station. "They got defiant, aggressive, and the officer had no other choice to defend himself, I think."

The two men, Sidney Williams, 37, and Aaron Grissom, 36, were both arrested and charged with felony assault, resisting arrest, menacing, disorderly conduct and loitering charges.

CALIFORNIA POLICE OFFICER IN 'VIOLENT FIGHT' CAUGHT ON VIDEO WITH SUSPECT WHO THREATENED TO 'SHOOT YOUR A--'

New York City Mayor Bill DeBlasio told ABC7 the video was "troubling." But the mayor said his understanding was that the people involved were a "real problem for neighborhood residents."

Williams was previously seen in a video boasting about suing the NYPD, the New York Daily News reported.

CLICK HERE TO GET THE FOX NEWS APP

The head of the NYPD’s largest union said the video didn't show that one of the men, who was previously arrested for assaulting an officer, threw a punch at the cops soon after they emerged from the subway.

"Once again, we are seeing the consequences of lax policies that have allowed a lawless atmosphere to flourish in the subways, endangering both commuters and the cops who respond to protect them," PBA President Pat Lynch said in a statement. "The predictable rush to judgment based on a partial video will once again obscure the larger issue: the chaos that our city's leaders have decided to permit in the transit system is not bubbling up onto the streets."