Those found guilty face up to two years in jail, leading campaigner Gina Martin to praise the bill as "politics and society at its best".
Members of the upper House of Lords on Tuesday gave the bill the final seal of approval, and it now only requires the formality of Royal Assent.
Prime Minister Theresa May personally backed the legislation, saying the practice left victims "feeling degraded and distressed".
The bill was briefly held up last year when a single MP blocked it by shouting "Object!" during a parliamentary vote.
Christopher Chope, a member of May's Conservative Party, claimed he was objecting to the manner in which the bill was introduced, but was met with cries of "shame" from MPs.
Martin tweeted that she was "over the moon" about the vote, adding "I AM EXHAUSTED AND SO HAPPY!".
From Liverpool in northwest England, Martin was attending a music festival in London's Hyde Park when a man rubbed against her while his friend lurked nearby.
"Five minutes later, I saw that his friend... was watching a picture taken very close to a woman's crotch," she told AFP earlier.
"I knew it was me immediately." Martin grabbed the phone and showed the image to police officers, but "they said 'we can't really help you'." She then decided to campaign to make it illegal, collecting more than 100,000 signatures of support in an online petition. (AFP) AMS