A senior adviser to former President Barack Obama resigned in the final days of the Obama administration, and was later convicted of following women on the D.C. Metro and trying to take pictures up their skirts, newly released documents reveal.

William Mendoza stepped down after being arrested and charged with attempted voyeurism in November 2016, according to the Daily Mail.

The former executive director of the White House Initiative on American Indian and Alaska Native Education, who was also a Department of Education official, attempted to take photographs and videos up women’s skirts at least four times while using his government issued iPhone in July 2016.

During the investigation by the Metro Police Transit Department, Mendoza was caught on surveillance camera trying to take an indecent photo.

At the time he took the photos, Mendoza was supposed to be at work and was using a travel card funded by taxpayers, documents obtained under the Freedom of Information Act reveal.

Mendoza was also caught watching footage of a woman in her underwear being filmed in secret while getting changed in a dressing room. However, it is unknown whether or not Mendoza was the one who recorded the video.

After resigning in November 2016, Mendoza pleaded guilty to the charges in January 2017.

Mendoza’s lawyer Paul Kiyonaga said Mendoza received treatment after the conviction.

“Mr. Mendoza has taken responsibility for this charge of attempted voyeurism,” 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.”