Shocking video shows pandemonium breaking out at a Florida back-to-school event as a gunman opens fire.

A bystander shot the gunman, who was hospitalized with life-threatening injuries Saturday after the incident at the “Peace in the City” event in Titusville, police said.

Facebook Live video shot by Dwight Harvey shows women and children rushing frantically into a park pavilion as rapid gunshots ring out.

People can be heard crying and shrieking and one woman in a red shirt can be seen shaking as she clutches a child’s hand and says: “It happened right where we were standing, right there.”

Police said the gunman got into a fistfight at Isaac Campbell Park and returned with a weapon several minutes later, unleashing 12 rounds, WFTV-9 reported.

The good Samaritan, an unidentified vendor, drew his licensed, concealed handgun and fired at the assailant, who was running toward the crowd, according to Florida Today.

The bystander waited for police and was cooperating with the probe, officials said. He was not expected to face any charges.

“We are extremely grateful that nobody else was injured in this incident,” said Deputy Chief Todd Hutchinson. “This suspect opened fire at a crowded public park, this could have been so much worse.”

“Peace in the City” was a backpack giveaway event organized by Harvey’s son, to honor a cousin who was found dead in a burning car in Mims in July.

In Harvey’s video, children can be seen rummaging through backpacks filled with school supplies shortly before the shots erupt.

“We were just trying to do something positive for the community,” he said.