A Brooklyn boy was found wandering alone on the J train subway tracks.

Police say the 8-year-old was reported missing around 12:20 p.m. Tuesday after he walked out of Brooklyn Excelsior Charter School in Bedford-Stuyvesant.

Around 20 minutes later, the boy was spotted walking on the J train tracks at the Halsey Street elevated subway station. 

Police say straphangers were able to get him off the tracks and stayed with him until officers arrived.

The boy was taken to Woodhull Hospital for evaluation.