Hundreds of federal workers have been caught watching porn on the job, including viewing child pornography, according to a new investigation.

NBC News 4 in Washington, D.C., identified over 100 "egregious" cases during the past five years where federal employees watched porn for hours during the day or required an inspector general investigation into their porn habits at work. The report relied on records obtained through Freedom of Information Act from 12 separate government agencies.

"The cases include workers who admitted spending six hours a day surfing illicit images and videos and maintaining tens of thousands of adult images on their office desktops," the report said.

The investigation revealed over 20 cases at the Justice Department during the past two years, and numerous cases at the Environmental Protection Agency.

The report includes the notorious case of an EPA employee in the Office of Air and Radiation who, while earning a $120,000 salary, watched porn between two and six hours every day, masturbated at work, and received bonuses.

The employee said that "‘a lot' of his time each workday is spent ‘organizing' the pornography he downloaded into saved folders," according to the records obtained by NBC News 4.

The report noted that although being caught watching porn "opens employees to possible disciplinary action," including being fired, several agencies said penalties are "flexible" and can carry just a written reprimand.

The EPA employee was not fired and stayed on the payroll for years even though he had been banned from the building. He continued to receive his six-figure salary for two years after being caught, including a year of paid leave before he retired in April 2015.

"This is not just an isolated incident at one single agency," said Rep. Mark Meadows (R., N.C.), who is pushing legislation for a zero tolerance policy toward viewing pornography on government computers. "We're starting to find it across almost every agency."

New cases uncovered by NBC News 4 included another EPA employee in San Francisco who watched porn at work an average of two hours a day, and an EPA contractor in North Carolina who viewed porn for three to four hours a day.

Workers at a Department of Transportation office in Washington, D.C., that was monitored for two months were found to be searching on government computers for "teen+underwear+blonde," "teen+slut+tight+pants," "orgy+prague+OR+Czech," and "petite+blonde+teen."

A Department of Justice worker in Tucson, Ariz., visited 2,500 adult websites and downloaded over 1,100 pornographic pictures at work, spending the "majority of his duty time viewing inappropriate adult websites."

Another Justice employee in Dallas, Texas, watched porn between four and six hours every day at work and had "tens of thousands" of pornographic pictures on a work computer, "including some which might have been child pornography."

Several other cases involved child pornography as well, including an FBI employee in Virginia who had explicit email exchanges with a ninth grader and admitted to "receiving, viewing, and saving approximately 50 images of suspected child pornography."

The investigation covered the departments of Transportation, Justice, Interior, Labor, Commerce, Energy, and Health and Human Services, as well as the U.S. Postal Service, NASA, Export-Import Bank, the EPA, and the Social Security Administration.