ALBANY, N.Y. — New York state would make it illegal for police officers to have sex with people in their custody under a proposal gaining momentum in Albany.

The idea picked up the support of Gov. Andrew Cuomo on Wednesday, who said he’ll amend his state budget proposal to include language saying that people in police custody cannot legally give consent to engage in sexual activity.

Current law bars sex between correctional officers and inmates, but it doesn’t apply to police and people in their custody. Cuomo, a Democrat, called that omission an “egregious loophole” that must be closed.

“There must be zero tolerance for sexual abuse and harassment across the board, and especially among those in positions of authority,” the Democratic governor said in a statement announcing his support. “This common sense reform closes an egregious loophole and helps protect against abuse in our justice system.”

The effort comes after two New York City police detectives were charged with handcuffing and then sexually assaulting an 18-year-old woman in Brooklyn last fall.

Prosecutors say the detectives stopped the woman in September for suspicion of drug possession. They say DNA evidence matches the detectives.

The detectives’ lawyers have said the woman’s account is not credible.

Legislation to clarify that people in police custody lack the legal ability to consent to sex with an officer has already passed the state Assembly and is pending in the state Senate.

More than half the states lack laws specifically forbidding officers from engaging in sex with people they take into custody