Video has emerged that shows the moment an armed gunman was fatally shot by the NYPD on Sunday after he opened fire during a Christmas concert outside a church in New York City

The video, which is about four minutes long, was posted on Facebook by a person who attended the outdoor concert with his family at the Cathedral Church of St. John the Divine in Harlem.

WARNING: GRAPHIC VIDEO

In the video, the gunman, who was dressed in black, can be heard shouting, "kill me, kill me," before he is fatally shot on the steps of the cathedral. 

"I figured that I should take a video of this thing that could have been far worse than just the shooter getting shot and killed," Steven Wilson, who posted the video, wrote. He said he only recorded the video after he knew his family was safe.

NYPD SHOOT ARMED SUSPECT AT CATHEDRAL CHURCH OF ST. JOHN THE DEVINE

During the incident, at least one officer was seen taking cover behind some garbage cans, as he pleaded with the man to drop his gun,  the video shows. 

After the first series of shots rang out, the suspect took cover behind a pillar in front of the church's doors. 

Another officer joined the officer behind the garbage cans, leading to more gunshots, as the suspect was seen coming out from behind cover, before retreating.

The fatal shots rang out soon after. 

“They got him, they got him,” the man filming is heard saying after the suspect fell to the ground. 

NYPD Commissioner Dermot Shea said police responded to the scene quickly. There were a community affairs detective and a police officer in the vicinity, and a sergeant located at St. Luke's Hospital also responded. A total of 15 shots were fired at the gunman.

At least one of the shots struck the gunman in the head. He was taken to the hospital in critical condition, and was later pronounced dead.

New York police officers carry a suspected gunman in a stretcher down the steps of Cathedral Church of St. John the Divine, Sunday, Dec. 13, 2020, in New York. (AP Photo/Ted Shaffrey)

NYC HAS FREED THOUSANDS OF GUN SUSPECTS THIS YEAR AS SHOOTINGS SOAR: NYPD

“I can tell you from the preliminary body camera – and again, this is quick – that we watched, you see three officers acting heroically, sergeant, detective, and police officer, engaging an armed perpetrator, putting themselves in harm’s way to pull people that are literally hiding behind these poles behind me caught in the crossfire,” Shea said. “So it is by the grace of God today that we don’t have anyone struck.”

Police recovered two semi-automatic firearms owned by the suspect at the scene. In addition, police found a bag nearby believed to be owned by the suspect, which contained a full can of gasoline, rope, wire, multiple knives, a Bible and tape.

Authorities are currently investigating the motive behind the incident. The identity of the gunman, who Shea said is believed to have a "lengthy criminal history," has not been released as police await fingerprint verification. 

CLICK HERE FOR THE FOX NEWS APP

The Christmas performance was the cathedral’s first public event since the coronavirus pandemic hit the Big Apple, according to the New York Post

Fox News' Lucas Manfredi contributed to this report