A senior policy adviser for former President Barack Obama resigned and was convicted of sex crimes after following women and taking photos up their skirts, according to documents released Monday.

The Daily Mailreported that William Mendoza, 42, stepped down from his position as executive director of the White House Initiative on American Indian and Alaska Native Education in November 2016 after authorities arrested and charged him with attempted voyeurism.

Mendoza, who took home a $140,000 salary while working in the Obama administration, attempted to take photos and videos up women’s skirts while they were riding on the Washington, DC, Metro at least four times in July 2016 with a government-issued iPhone.

Authorities also caught Mendoza looking at footage of a woman in her underwear putting on clothes in a dressing room.

An investigation by the Metro Police Transit Department revealed that surveillance footage caught Mendoza on camera trying to take an indecent photo.

Police arrested Mendoza after reviewing the footage and charged him with one misdemeanor count of attempted voyeurism.

Documents obtained by the Daily Mail through a Freedom of Information Act request revealed that Mendoza was using a taxpayer-funded travel card and was taking the photos while he was supposed to be working.

The former adviser pleaded guilty to the misdemeanor in January 2017, and a judge gave him a 90-day suspended sentence, one year of probation, and a $100 fine. Mendoza has not worked in public office since his conviction.

A lawyer for Mendoza said his client has “received treatment” and is moving on with his life after the conviction.

“Mr. Mendoza has taken responsibility for this charge of attempted voyeurism,” his attorney Kiyonaga said, “He’s received treatment for the underlying issues that gave rise to this incident, and, with the strong support of his family, is moving forward productively with his life.”

This is not the first time the former Obama adviser has ran into trouble during his time in the White House.

Mendoza had also been accused of getting into a physical altercation with a college student wearing a Washington Redskins jersey. No charges were filed in the October 2015 incident.