A cop in Lowell, Massachusetts, has been charged with rape after accusations that he repeatedly sexually assaulted a 16-year-old homeless girl in her tent in exchange for not arresting her.

Kevin Garneau, a 19-year veteran of the police force, is facing up to 40 years in prison for two counts of rape. A grand jury indicted him Wednesday, and he’s pleaded not guilty, according to the county’s district attorney.

Garneau’s police department didn’t learn about the allegations until January — nearly three years after the alleged assaults — and placed him on desk duty during an internal investigation, the status of which is unclear, according to the Lowell Sun. He’s currently on unpaid leave and was on paid leave up until the indictment.

Garneau’s lawyer, Robert Normandin, told VICE News via email that Garneau is “totally innocent of this 3-year-old accusation.” “Officer Garneau has been a dedicated police officer for the city of Lowell for 20 years and looks forward to this case being over so he can go back to work,” Normandin said.

Garneau allegedly entered the unnamed 16-year-old’s tent beside the local train tracks when he was on duty and told her she had multiple warrants out for her arrest. It’s unclear whether those warrants existed. But he said he wouldn’t arrest her in exchange for sexual services, according to the Middlesex District Attorney. He then came back and assaulted her “several more times in the months after the initial assault,” District Attorney Marian Ryan said in a press release.

At the time of the alleged assaults in 2016, the 49-year-old officer was working as part of a local law enforcement outreach group to the city’s homeless population and people using opioid drugs.

It’s unclear how long Garneau served as his police department’s homeless liaison, but he was involved in annual homeless counts at tent encampments across Lowell, the Lowell Sun reported. He’s also a well-known bike cop, and his colleagues said “people treat him more like a confidant than a police officer,” according a 2016 article from the paper.

Young homeless people are often at risk for abuse, according to the National Sexual Violence Resource Center, which found that 21% to 42% of homeless youth report sexual abuse. A 2014 survey from the University of Nebraska-Lincoln also found that 14.5% of adolescents experienced rape or sexual assault when they were living on the streets.

Garnaeu was released on his own recognizance — a promise to return to court without bail — and fitted with a GPS monitor, according to the Lowell Sun. He’s been ordered to avoid the alleged victim, who has not been named.