NEW YORK (WPIX) — The New York Police Dept. has released shocking new video of gunfire erupting right outside of a Bronx elementary school earlier in October.

Police said if school had let out just a bit earlier, children would have been caught in the crossfire.

Authorities said it happened around 2:50 p.m. on Oct. 5, just outside the Boys Prep Bronx Elementary School.

Two groups, estimated to be men or teenagers in their late teens or early 20s, exchanged gunfire, police said.

The gunfire put the school of about 800 students, grades K-8, on lockdown, according to Principal Dr. Khalek Kirkland. He said the local precinct notified the school immediately.

“The crime is horrific and we just want to make sure that we’re keeping our scholars safe,” Kirkland said. “So we were able to make sure that no only did none of our students leave the building, but we were also able to put our families safe as well, those [that] were picking up their children,” he added.

A group of three included one shooter, who shot at another group of two, one of which was the other gunman, according to police. No injuries were reported.

“Boys Prep will be a beacon in the South Bronx,” Kirkland said. “We pride ourselves on education and will continue to do that,” the principal added.

No arrests had been made as of Thursday morning.

The footage comes as the city deals with an ongoing trend of gun violence among children and teens.

Separately, just a day ago, the NYPD said three public school students were caught bringing firearms to school, two in the Bronx and one in Brooklyn.

First, a gun was found in a 15-year-old boy’s backpack at Mott Haven High, prompting a lockdown, authorities said.

Then, police said an 18-year-old was also found with a gun in his bag at Stevenson High School, which was discovered when his bag went through an X-Ray machine.

A few hours later in Brooklyn, a 17-year-old boy brought a loaded gun to school at Franklin Delano Roosevelt High School, police said.

According to NYPD data, the number of youth shooting victims has nearly doubled this year compared to the same time period just two years ago.

Between Jan. 1 and Sept. 26, there were 89 shooting victims ages 17 and younger — up from 84 in 2020 and 45 in 2019, per the NYPD.

Sixteen children or teens were killed by gunfire between Jan 1. and Sept. 26, an increase of over 136% compared to the same time period in 2019, when three young lives were claimed. In 2020, there were seven fatal shooting victims aged 17 or younger during the same time frame.

PIX11’s Lauren Cook contributed to this report.