A frightening traffic collision was caught on security camera Thursday morning when a livery cab driver lost control of his vehicle while having a heart attack, drove up onto the curb, and struck a 13-year-old girl on a sidewalk in Brooklyn.

An NYPD spokesperson said the 48-year-old driver lost consciousness near the intersection of 18th Avenue and 55th Street in Borough Park just before 8:15 a.m. yesterday. The driver struck the young girl, throwing her into a nearby lawn, before coming to a stop.

Emergency responders rushed both the driver and pedestrian to Maimonides Medical Center. The unidentified girl was treated for an ankle sprain and released, but an NYPD spokesperson confirmed the driver remains in critical condition.

Security footage of incident, above, shows a passenger in the backseat trying to escape the speeding car.

Speaking with ABC News, the young girl's father credited her heavy backpack with cushioning her fall.

"The backpack was very full of books, and that's what pulled her back," he told the network.