Heart-stopping video captures the moment hero cops shoot and kill Connor Betts during his murderous rampage in Dayton, Ohio — with him collapsing just steps from the front door of a packed bar.

Surveillance footage shows dozens of joyful revelers, some hugging warmly, forced to suddenly flee for their lives as the masked 24-year-old starts firing his legally purchased AR-15-style rifle with magazines capable of holding at least 100 rounds of ammunition.

Betts can be seen wearing a bulletproof vest as he races toward a bar with his rifle raised.

But he collapses just steps from the front door as cops gun him down.

Another angle shows at least six officers rushing forward with guns drawn, with officials saying they were able to stop Betts just 30 seconds after the massacre started.

He was still able to kill nine people — including his own sister — and wound 27 more in his rampage just after 1 a.m. in Dayton’s popular nightlife district.

“We will never know how many lives were saved,” Gov. Mike DeWine said at a Sunday afternoon press conference. “The assailant was obviously very, very close to being able to kill dozens and dozens more people.”