A man caught on video nearly setting himself on fire after he sparked a blaze at a Staten Island gas station was arrested, cops said Friday.

Fakrol Islam, 26, was charged with arson and reckless endangerment for igniting the massive burst of flames outside a 7/11 at Richmond Avenue and Victory Boulevard early Monday morning, according to police.

Islam could be seen on video filling a portable gas tank and intentionally spraying the gas on the floor before lighting a piece of paper with a match.

A 21-year-old man nearby suffered minor injuries in the blaze.

Islam was apprehended by the NYPD upstate in Buffalo, New York, with assistance from the Buffalo Police Department, police sources told the Post.

He was being treated an area hospital Friday night.