BROOKLYN — A correction officer was beaten unconscious by an inmate, and the entire encounter was caught on video, police source said Wednesday.

The incident happened at the Brooklyn Detention Complex around 1:40 p.m. Tuesday, according to law enforcement sources.

On Wednesday, a second correction officer was attacked by five alleged Blood gang members, officials said. The officer's condition, and additional information on the incident, including which jail the assault happened at, were not immediately available.

Video of the Tuesday attack captures the disturbing moments when a correction officer was beaten by an inmate who had been arrested on murder charges.

The surveillance video shows a correction officer closing a gate within a stairwell, when suddenly, an inmate runs up the staircase, opens the gate and confronts the officer.

Sources have identified that inmate as Pariis Tillery.

Two more inmates then enter the gated area and corner the correction officer.

After a brief moment, the officer pepper sprays Tillery, then the inmate begins punching the officer repeatedly in the face until the officer falls to the floor.

The correction officer was left unconscious with a broken nose and a broken jaw, police sources said.

Tillery is accused of killing Rysheen Ervin on Sept. 21, 2016.

Ervin was shot multiple times in East New York. State Sen. Jesse Hamilton witnessed the incident.

The Correction Officers' Benevolent Association President Elias Husamudeen released a statement saying:

“Today, in The Brooklyn House of Detention, a New York City Correction Officer was brutally assaulted and beaten by an inmate. This marks the third assault on one of our Correction Officers in less than two weeks. The officer is now being treated at a hospital for his injuries. My message to Mayor Bill de Blasio and Commissioner Cynthia Brann is what are you doing to prevent these assaults besides from simply rearresting and transferring assaultive inmates from one jail to the next? What are you doing to stop these emboldened inmates who are assaulting Correction Officers nearly every week? What do you have to say to this officer and to his family who are suffering because of your failed policies? This officer needs more than just a phone call from you!”

PIX11's Anthony Dilorenzo and Narmeen Choudhury contributed to this report:

Correction: This report previously erroneously described the suspect involved as a Rikers inmate. It has been updated.