A family was sitting inside their car near the Castro on Wednesday when a man reached through the backseat window and tried to grab two boys, police said.
The incident unfolded near 17th and Sanchez streets at around 7 p.m. when the man attempted to kidnap the children, aged two and four, according to police.
The man, 44, was arrested after a person, described by authorities as a third victim in the incident, confronted him and called police. His name has not been released.
Police did not immediately respond to a request for further information on the attempted kidnapping.
No one was injured in the case.