Police on Wednesday arrested a mentally ill neighbor of an advertising executive who was found dead with her throat slashed in her Upper West Side co-op building last week.

Anya Johnston, 24, was charged with killing 70-year-old Susan Trott inside her apartment on West End Avenue near 95th Street on Oct. 21, cops said.

Johnston had a history of mental problems and was previously committed to hospitals in 2014 and 2016 for her erratic behavior, police sources said.

Just days before Trott’s body was found, Johnston’s mother called police on Oct. 17 to report her daughter was missing and acting irrationally, the sources said.

Police don’t have a motive in the slaying, but have pointed to Johnston’s mental issues, sources told The Post.

“She’s an EDP. That’s the motive,” one source said, referring to the police acronym for an emotionally disturbed person. “She was crazy talking about harming herself and harming other people,” another source added.

Police responded to Trott’s home early that day when her business partner called authorities because he had not heard from her in several days.

Cops followed a trail of blood on Trott’s floor to the bedroom, where they found her body, authorities said.

“I’m pleased to announce an arrest has been made in the murder of Susan Trott,” NYPD Chief of Detectives Dermot Shea wrote on Twitter Wednesday afternoon.

A day after Trott’s murder, Shea said at a press conference that police had a person of interest in the slaying who was being held at a hospital for a psych evaluation. He added that all the answers in the killing would be inside the tower at 710 West End Ave.

Police believe Trott and Johnston had problems with each other previously, but it’s unclear what those fights were about, police sources told The Post.

Trott’s friends and neighbors told The Post that she was constantly harassed in the building for a number of reasons — including her habit of feeding birds on the sidewalks outside.