Waliyatou Amadou died after being stabbed in a Northwest Washington apartment building. (D.C. Police)

A woman who died after being stabbed on Sunday in an apartment building in Northwest Washington had argued with her attacker about whether he had previously sexually assaulted her, police said in an arrest affidavit filed in court.

The new details provide a possible motive in the violent death of Waliyatou Amadou, who was found wounded in the second-floor hallway of a co-op in the 1400 block of W Street Northwest, along the vibrant U Street corridor. She died later at a hospital.

Police on Wednesday arrested Deangelo Demetrius Thorne, 27, of no fixed address, and charged him with second-degree murder. A D.C. Superior Court judge ordered Thorne detained until a preliminary hearing Jan. 19.

Authorities described Thorne as an acquaintance of Amadou who sometimes lived on the streets and battled mental problems. Police listed Amadou’s age as 23; her family said she was 21. She and her family came to the United States about 19 years ago from Togo. Her father worked as a chauffeur for the Togo Embassy.

Amadou’s parents returned to the West African nation several years ago, but their children remained in the United States. Amadou’s sister and father said she refused to stay with relatives.

Thorne has listed several addresses in public documents, the latest in Trinidad in Northeast. But police said a relative there denied that Thorne lived with him. He also has listed a homeless shelter and a substance-abuse clinic in Northwest Washington as residences. Attempts to reach relatives failed.

Last year, Thorne sued a relative who he said kicked him out of her home. “I am trying to get back in,” he wrote in his complaint, which was dismissed.

At the time of the killing, Thorne was awaiting a Feb. 10 sentencing on a 2016 drug conviction and was wearing a tracking device. He has two other 2016 criminal cases pending, one for assault. In 2015, he served 15 days in jail for assaulting a police officer and 30 days for destruction of property.

On Sunday night, police said that Thorne, Amadou and another person were arguing outside the W Street apartment building about whether a previous sexual encounter was an assault or consensual. Amadou went into the building and Thorne followed, police said in the affidavit.

Inside, the two argued near a boiler room, police said in the complaint, noting that the confrontation was captured on surveillance video. Police said Amadou appears to strike Thorne with her shoulder or hand. Police said Thorne then stabbed Amadou five times in the chest with a gold-handled knife, and she is seen falling facedown to the floor, her hands in her pockets.