It happened around 12:30 Friday morning on the 1900 block of Green Street in the Fairmount section of Philadelphia.
"It's frightening. I wouldn't expect it on this block in this neighborhood," said Jenna Folk, neighbor.
The woman told police a clean cut looking man was sitting on the steps when she walked up.
As she was going into the building, he allegedly pulled out a knife and forced her inside.
"Thankfully with her struggle and screams the attack is interrupted which forces him to run off," said Capt. John Darby.
A neighbor came out scaring the suspect away.
The victim wasn't physically hurt but police are trying to make sure this doesn't happen to anyone else.
"His motivation appears to be sexual in nature. He didn't demand money or attempt to take anything so we are very much on focus to get this guy off the street," said Capt. Darby.
Word of the attack has neighbors looking out.
"I think if I saw someone on my steps and I'm coming home in the middle of the night, I'd keep walking. I wouldn't get my keys out or head in the direction of my home," said Folk.
Anyone with information is asked to contact Philadelphia Police by calling 215-686-TIPS (8477), texting a tip to PPDTIP (773847) or through PhillyPolice.com.