NEW YORK — A man arrested more than two dozen times for posing as a transit worker to steal buses and trains and drive the routes was sentenced Thursday to up to 5 years for his latest caper.
Darius McCollum, 49, nodded politely and answered ‘‘yes’’ as the sentencing began. He pleaded guilty earlier this year to stealing a Trailways bus in 2010, when he was arrested behind the wheel on the highway that leads to Kennedy International Airport.
He had faced up to 15 years if convicted at a trial, but the Queens district attorney and his lawyer worked out a deal: McCollum will voluntarily enter a program in which he will undergo cognitive behavioral therapy when he gets out of jail. McCollum was diagnosed with what was until recently called Asperger’s syndrome but is now referred to as an autism spectrum disorder.
‘‘Hopefully . . . this is the end of this stuff,’’ said Queens Supreme Court Justice Barry Kron.