ST. PAUL (AP) — Minnesota lawmakers are on the verge of passing legislation to make it illegal for police officers to have sex with people in their custody.

The state House approved Tuesday a public safety bill that includes a provision that would close what some say is a sexual assault loophole.

Minnesota police officers can currently argue that sex is consensual, despite what many advocates say is an imbalanced power dynamic.

The bill would make it illegal for officers to have sex with someone in their custody or anyone who doesn't reasonably believe that they can freely leave the officer's presence.

Advocates for sexual assault victims say it's a long-overdue change.

The bill has now been referred to a Senate finance committee.