Andrew Harvanek, 55, was driving a 2009 Mazda on Randall Road when he lost control and slammed into a tree north of Middle Country Road just before 1 a.m. Saturday.
Witnesses said that Harvanek collapsed near the vehicle as he got out and the Mazda burst into flames.
Seventh Precinct Officer Kristopher Miller pulled Harvanek away from the car and dragged him to safety, police said.
Harvanek was taken by ambulance to John T. Mather Memorial Hospital in Port Jefferson where he was treated for non-life-threatening injuries. The Ridge Fire Department responded and put out the flames, police said.
Harvanek was held overnight awaiting arraignment in First District Court in Central Islip.