An armed robbery in Queens led to police chase that ended in a fiery crash early Tuesday, police said.

Three men allegedly robbed a 7-Eleven convenience store in the Murray Hill area of Queens at about 2 a.m. when one of the victims inside the store managed to get out, police said.

The man flagged down a passerby who called authorities with a description of the alleged robber's 2014 Nissan Altima.

A police officer then spotted the vehicle and proceeded to chase the three men, police said.

But after a lengthy attempted getaway, they crashed into a commercial building on Pidgeon Meadow Road, more than a mile south from the store. The car then erupted in flames just before 2:30 a.m., said an FDNY spokesman.

Not to be deterred, the men tried to flee. But they were apprehended a few blocks away with $400 allegedly stolen from the store, police said.

A shotgun was recovered as well, police said.

Investigators are looking into whether the men can be connected to other armed robberies. Charges were pending in yesterday's incident, police said.