Solomon Alemu was taken into custody at 10:51 a.m. after he was found in the stolen vehicle with the child still inside in front of 555 Seventh St., according to police.
"The baby was fine. It wasn't crying, it was alert and awake," said Sgt. Kin Lee.
The child was recovered and Alemu was arrested on suspicion of vehicle theft, kidnapping, child endangerment and probation violation, according to police.
The vehicle theft and kidnapping had occurred about 10 minutes earlier after the girl's father pulled over in the 100 block of Golden Gate Avenue, according to police Officer Grace Gatpandan.
He had pulled over because someone had kicked the car while they were stopped at a traffic light, but Gatpandan said it was unclear whether that person had any connection to the car theft.
When the victim got out to see if there was any damage to the car, the suspect got in and drove away with the child in the back seat.
Police were alerted and a sergeant quickly spotted the vehicle on Seventh Street, just in front of the public defender's office.
Police called medics to the scene to examine the child, but she was unharmed.
"Essentially, it's a happy ending with the baby not injured in any way," said San Francisco Police Department spokesman Officer Albie Esparza.