The 33-year-old thief with a criminal record is thought to have stolen as many as seven vehicles in recent months.
Operating near Madrid's Atocha and Chamartín train stations, he waited until drivers were unloading clients' suitcases before making off with the vehicles.
He then stripped the taxis, selling off valuable spare parts before dumping the cars on the outskirts of the Spanish capital.
But the thief was arrested after he accidentally drove off in a vehicle with one passenger's baby inside, police said.
Investigators are now trying to find out if he was involved in more taxi thefts, Spain's 20 minutos newspaper reported.