London (CNN) Upskirting is now a criminal offense in England and Wales, after a campaign by a woman who was targeted by an offender at a music festival.

The offense -- which involves taking a photo under an individual's clothing with the intention of viewing their underwear, genitals or buttocks without their knowledge -- will be punishable by up to two years' imprisonment, with the most serious offenders being placed on the sex offenders' registers, Britain's Ministry of Justice said Friday.

"We have always been clear -- there are no excuses for this behavior and offenders should feel the full force of the law. From today, they will," Justice Minister Lucy Frazer said in a statement.

The legislation gained traction in Parliament after a campaign by Gina Martin, who became a victim of upskirting at the British Summer Time music festival in 2017.

Martin, now 27, reported the incident to the police but was shocked when they declined to prosecute. She subsequently discovered that upskirting was not a specific offense under English law.

Read More