WASHINGTON — House lawmakers Wednesday overwhelmingly passed new rules making the secret recording or unauthorized sharing of nude photos a crime under military law, in response to the Marine Corps United scandal earlier this year.

The move is designed to close a loophole in the Uniform Code of Military Justice which military leaders had said could prevent them from fully prosecuting troops who took secret nude photos of colleagues or shared those types of private photos online without permission.

In March, those issues came to light after a report by the War Horse website uncovered hundreds of Marines involved in sharing thousands of nude photos of female colleagues and friends, in many instances against their will.

Much of the activity was through a Facebook group named Marines United, although numerous similar sites were found as investigators began looking into the problem. Several groups have since been shut down.

Service leaders have vowed to kick troops involved in the photo sharing out of the ranks, but have told lawmakers they're unsure if they can prosecute them for criminal activity given gaps in the UCMJ.

Bill sponsor Rep. Martha McSally, R-Ariz. — a retired Air Force colonel — called that unacceptable.

"The Neanderthals who committed these acts are not emblematic of the vast majority of decent and honorable service members who serve our nation," she said on the House floor Tuesday. "However, the notion that any service member would think it is acceptable to upload, view, or comment on nude photos of their fellow service members is a serious problem that must be fixed."

The measure passed by a vote of 418-0.

It still must be passed by the Senate and signed by the president before the new rules are added to the UCMJ.

So far, more than 30 Marines have been referred to their commanders for online misconduct related to the photo sharing. Five have received nonjudicial punishment. None has appeared before a court-martial.

Before the vote, Rep. Jackie Speier, D-Calif., praised the bill as necessary step but warned it will not eliminate what she sees as cultural misogyny in the military.

"Our work is not done," she said. "If the chain of command continues to see nonconsensual pornography as a ‘boys will be boys’ joke instead of sexual violence, nothing will change.

"Such conduct must result in severe and immediate consequences for the perpetrators. (This bill) must pass, and it must be enforced."

Military leaders have appeared on Capitol Hill multiple times in the last two months to respond to those allegations, each time promising that abuse against women both in the service and outside the military will not be tolerated.

Leo Shane III covers Congress, Veterans Affairs and the White House for Military Times. He can be reached at lshane@militarytimes.com.