Police said the victim struck up a conversation with the suspect, 57-year-old Arthur Salinas, at a store in the 1400 block of Sutter Street near Van Ness Avenue at about 11 p.m. Saturday.
When the victim left the store, Salinas walked with her for a block, then allegedly forced her into a stairwell where he attacked and sexually assaulted her, according to police.
Police said Salinas then fled and the victim went home, where her roommate called 911. The victim was then taken to a hospital to be treated for her injuries, police said.
Investigators spoke with an apartment building manager in the 1300 block of Sutter Street who said Salinas matched the description of the attacker.
Salinas was located at Sutter and Franklin streets and taken into custody. He was booked into jail on suspicion of kidnapping, false imprisonment, aggravated assault and sexual assault, and failing to register as a sex offender. He had a history as a sexual offender in Texas, police said.
Investigators are now checking other open cases in San Francisco to see if Salinas may have been responsible for any unsolved cases, according to police.