An Islip Terrace man was arrested barely a block from his home — and barely a quarter-mile from the crime scene — about 20 minutes after he robbed a gas station on the Sunrise Highway north service road late Thursday, police said.

Timothy Kaczynski, 23, was arrested on Seal Road at 12:17 a.m. Friday, 23 minutes after he robbed the Shell gas station in Islip Terrace at gunpoint, Suffolk County police said.

advertisement | advertise on newsday

Police said Kaczynski entered the station at 11:54 p.m., pointed a pistol at the attendant and demanded cash.

Police said that cash in hand, he then fled.

Seal Road is about a quarter-mile north of the station and about 1 1/2 blocks south of Kaczynski’s home on Floral Park Street. Police did not say if a weapon was recovered.

Kaczynski was charged with first-degree robbery. He faces arraignment Friday in First District Court in Central Islip.