A police officer was seen punching two teenagers during a wild brawl as cops tried to break up a fight between two groups of teenagers at a subway station in downtown Brooklyn on Friday afternoon.

Video of the incident at the Jay Street-Metrotech subway station in downtown Brooklyn went viral on social media over the weekend.

Five people were arrested, most of them for resisting arrest and disorderly conduct, according to the New York Police Department.

Officers said that they received reports of a fight between two groups of teenagers that spilled into the subway station at around 2:20pm on Friday.

The images above taken from amateur video shot inside a downtown Brooklyn subway station on Friday afternoon shows a police officer punch a teenager during a wild melee

The officer is seen reaching his fist back before slugging the young male wearing a backwards baseball cap

The force of the blow knocked the teen to the ground. At least two officers descended on the teen and placed him under arrest

Video posted to Facebook by a witness appears to show a tense scene in which officers are working to separate two groups of teens on the subway platform.

One group of officers is seen standing around a teenage girl as she leans against a trash receptacle.

As the witness is recording, he repeatedly tells the officers that he will not put his phone away.

'I know my rights,' he says.

The witness then pans the camera toward another group of officers who appear to be trying to get someone under control.

The teenager appears to be resisting arrest, prompting the group of about three or four officers to wrestle him to the ground.

The same officer is then seen confronting another teen moments later

After the officer throws a punch, the teen retaliates, and the two begin to exchange blows

It is unclear from the video what the teen did to provoke the officer (seen right)

Moments later, a number of fellow officers move in to break up the second fight and place the teen under arrest. The teen is seen at the bottom right on the ground

While the officers struggle with the teen, another teen then comes into the picture and apparently tries to pull the cops off of the young person on the ground.

Seconds later, a uniformed police officer quickly approaches a young African American teen wearing a baseball cap and punches him in the face.

The force of the punch sends the young man to the ground as witnesses who saw the blow react audibly.

The officer who threw the punch and another officer wearing a white buttoned-down shirt descend on the teen and place him in handcuffs.

The New York Police Department said on Sunday that officers received a report at around 2:20pm on Friday of two groups of teenagers who were fighting. That fight is said to have spilled into the Jay Street-Metrotech subway station in downtown Brooklyn

In total, five people were arrested on charges ranging from resisting arrest, disorderly conduct, and obstruction of government activity. Three 18-year-olds, one 15-year-old, and one 16-year-old were taken into custody

Officers try to calm the chaotic situation by forming a ring around the melee and asking passersby to allow police to defuse the tension.

The officer who threw the punch is then seen confronting another black teen in a white hooded sweatshirt and black sweatpants.

The officer appears to throw a punch at the teen, who responds by throwing punches of his own.

As the officer and the teen exchange blows, a number of other officers separate the two and place the teen under arrest.

A number of witnesses are then seen taking out their cell phones to record the arrest.

The video does not make clear why the officer punched the second teen.

The NYPD has yet to identify those who were arrested.

A 15-year-old was charged with assaulting an officer and resisting arrest.

A 16-year-old female was charged with reckless endangerment, disorderly conduct, and obstructing government activity.

Three 18-year-olds were charged with resisting arrest and disorderly conduct.