On Friday evening, Isadore Sullivan Jr., 35, of Durham was arrested and charged with attempted first-degree rape, second-degree kidnapping and felony breaking and entering.
Sullivan was also charged with carrying a concealed gun.
The incident happened Thursday morning off Jackson Street near Duke University.
A woman told officers a man came to her apartment around 10 a.m. and said he was there to do a repair.
The man came into the apartment and pulled out a handgun, but the woman was able to get away and was not injured.