“Those who download and possess child pornography create a market that causes more children to be harmed,” United States Attorney Eileen M. Decker said. “Young victims are harmed every time an image is generated, every time it is distributed, and every time it is viewed.”

Salling was charged with both receiving and possessing child pornography, with each charge carrying a maximum sentence of 20 years in prison.

The indictment specifies that Salling used the Internet to receive a still image and a video depicting child pornography on Dec. 26, 2015. These images depicted young girls.

The second count in the indictment charges Salling with possessing two videos depicting child pornography on Dec. 29, 2015. The image and video also depicted young girls.

According to a statement from the U.S. Attorney’s office, Salling has agreed to surrender himself to federal authorities on June 3, when he will most likely be arraigned as well.

This is not Salling’s first encounter with the law. In 2013, a woman sued him for sexual battery and accused him of knocking her to the ground after she confronted him over the incident. The case was settled in March for $2.7 million, according to E! News.

Pamela Chelin contributed to this report.

9 Former Child Stars Who've Gone From Hollywood to Handcuffs (Photos)

Former child stars like Tatum O'Neal, Shia LaBeouf and Macaulay Culkin have all had trouble with the law.

Edward Furlong, once a rising star known for "Terminator 2" and "American History X," has been arrested multiple times as an adult for domestic violence.

Universal

Macaulay Culkin, star of the first two "Home Alone" movies, was arrested in Oklahoma City for possession of controlled substances in 2004.

Fox

Jake Lloyd, who played Anakin Skywalker in "Star Wars: Episode I -- The Phantom Menace," was arrested for reckless driving and resisting arrest in 2015. His mother later said that Lloyd had been suffering from schizophrenia.

Shia LaBeouf, who got his big start as a child actor on the Disney Channel show "Even Stevens," was charged with assault with a deadly weapon in 2005 after an altercation with his neighbor.

Getty Images

Former Nickelodeon star Amanda Bynes has been arrested multiple times since 2012, including for marijuana possession and DUI.

Getty Images

Orlando Brown, star of Disney Channel's "That's So Raven," was arrested in 2016 on drug charges after police allegedly found him in possession of meth.

Disney

"Diff'rent Strokes" star Dana Plato was arrested in 1991 for attempting to rob a video store at gunpoint. She died in 1999 after overdosing on painkillers.

Tatum O'Neal, who won an Oscar at age 10 for her role in "Paper Moon," was arrested in 2008 after she was caught buying crack cocaine.

Joey Cramer, star of Disney's "Flight of the Navigator," was arrested in 2016 for attempting to rob a bank in British Columbia

Disney

1 of 10

Tatum O’Neal, Shia LaBeouf and Macaulay Culkin have all had trouble with the law

Former child stars like Tatum O'Neal, Shia LaBeouf and Macaulay Culkin have all had trouble with the law.