A 23-year-old man was charged this week with robbing and raping a woman at gunpoint last May outside an apartment complex in Columbia Heights, according to D.C. police who said DNA linked the suspect to the crime.

The man, identified as Ryan Ramotar of Northeast, also is facing charges in a separate armed robbery that occurred in Northwest Washington’s Petworth neighborhood 10 days after the reported sexual assault, court papers show.

He was arrested a short time after that later attack, but released pending trial, and was re-arrested on the earlier sexual assault charge on Wednesday. On Thursday, a D.C. Superior Court judge ordered Ramotar detained. His next court appearance is scheduled for Thursday .

The first attack occurred about 1 a.m. after a man and his girlfriend parked in the back of a building in the 1500 block of Meridian Place Northwest. Two masked men went to either side of the car, pointed guns at the victims’ heads, ordered them out of the car and demanded money, police said.

Authorities said that while one gunman beat the man, the other forced the woman to an alley behind Oak Street . Police said he took a round out of his gun to prove to her it was loaded, then raped her with the gun pointed to her head. Police said the gunman then took her bank card and iPhone.

Court papers show that detectives recovered evidence with DNA on it from the scene, and got pictures of a suspect withdrawing $300 from the victim’s bank account at a bank machine on Georgia Avenue. After video of the withdrawal was made public, police said a person called with the suspect’s identity. Detectives obtained a search warrant to collect his DNA in December and police said a link was made in April.

At the time, Ramotar was already facing charges in an armed robbery that occurred May 16 in the 700 block of Varnum Street NW, near Petworth. Police said three masked men — one armed with a sawed-off shotgun, two with handguns — robbed a man of his cellphone, keys and wallet. Police said two men, including Ramotar, were caught and charged in the case.

Get updates on your area delivered via e-mail