BOSTON (CNN) -- Massachusetts lawmakers passed a bill Thursday banning "upskirting" in response to a ruling by the state's highest court that said a law aimed at criminalizing voyeurism did not apply to the snapping of secret photos up a woman's skirt.
The bill now goes to the governor for signing.
"The House took action today to bring Massachusetts laws up-to-date with technology and the predatory practice of 'upskirting.' We must make sure that the law protects women from these kind of frightening and degrading acts," House Speaker Robert A. DeLeo said in a statement.
Massachusetts' highest court had ruled Wednesday that it is not illegal to secretly photograph underneath a person's clothing -- a practice known as "upskirting" -- prompting one prosecutor to call for a revision of state law.
The high court ruled that the practice did not violate the law because the women who were photographed while riding Boston public transportation were not nude or partially nude.
"A female passenger on a MBTA trolley who is wearing a skirt, dress, or the like covering these parts of her body is not a person who is 'partially nude,' no matter what is or is not underneath the skirt by way of underwear or other clothing," wrote Justice Margot Botsford of the state Supreme Judicial Court.
The ruling stems from the case against Michael Robertson, 32, who was arrested in 2010 and accused of using his cell phone to take pictures and record video up the skirts and dresses of women on the trolley, according to court documents.
Two separate complaints were filed against Robertson with the transit police. Authorities then staged "a decoy operation" to catch Robertson, who was eventually arrested and charged with two counts of attempting to secretly photograph a person in a state of partial nudity. Police observed him point a cell phone video camera up the dress of a female officer, court documents state.
Wednesday's ruling reversed a previous decision by a lower court, which had denied a motion by Robertson seeking the dismissal of the case, said a statement from the Suffolk County district attorney's office.
"In sum, we interpret the phrase, 'a person who is ... partially nude' in the same way that the defendant does, namely, to mean a person who is partially clothed but who has one or more of the private parts of body exposed in plain view at the time that the putative defendant secretly photographs her," the high court ruled.
The ruling that state law "does not apply to photographing (or videotaping or electronically surveilling) persons who are fully clothed and, in particular, does not reach the type of upskirting that the defendant is charged with attempting to accomplish on the MBTA."
Prosecutors had argued that the current statute, which prohibits secretly photographing or videotaping a person who is "nude or partially nude," includes upskirting, according to documents.
But Robertson's lawyers argued that the female passenger on the trolley was not "nude or partially nude" and was not in a place where she had a reasonable expectation of privacy, according to court documents.
"Every person, male or female, has a right to privacy beneath his or her own clothing," Suffolk County District Attorney Daniel Conley said in a statement Wednesday. "If the statute as written doesn't protect that privacy, then I'm urging the Legislature to act rapidly and adjust it so it does."
Robertson faced misdemeanor charges punishable by up to two and half years in prison.