Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A Brooklyn man who faced 10 years for downloading child pornography was sentenced to five days by a federal judge who sharply criticized punishment guidelines for failing to distinguish between dangerous offenders and those who pose little threat.

U.S. District Judge Jack Weinstein wrote a 98-page decision explaining why he bypassed the guidelines and chose not to put the man in prison for possessing two dozen photos and videos — some showing men sexually assaulting girls as young as 3 years old, according to court papers.

"Removing R.V. from his family will not further the interests of justice," Weinstein wrote, using the defendant's initials.

Judge Jack Weinstein speaks with reporters after visiting the Louis Armstrong housing projects in Brooklyn in 2011. Bebeto Matthews / AP file

"It will cause serious harm to his young children by depriving them of a loving father and role model and will strip R.V. of the opportunity to heal through continued sustained treatment and the support of his close family."

His opinion, first reported in the New York Law Journal, is the latest salvo in a war over whether penalties for possessing child pornography have gotten too harsh.

The existing guidelines, Weinstein wrote, do not "adequately balance the need to protect the public, and juveniles in particular, against the need to avoid excessive punishment."

The defendant, who agreed to speak to NBC News on the condition his name was not used, said he was surprised and relieved that Weinstein was so lenient after his guilty plea.

"I prayed to God and took my chances," the 53-year-old father of five said. "I feel very remorseful. It's something that will never happen again."

But child-abuse victims' advocates said they were appalled by Weinstein's reasoning.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"I think Judge Weinstein's opinion minimizes the harm that is done to victims of these crimes from the mere act of viewing their images. It's a gross violation of privacy and an invasion of privacy that traumatizes them throughout their lives," said Paul Cassel, a former federal judge who is now a law professor at the University of Utah.

In 2013, investigators remotely connected to the man's computer and downloaded four photos and videos showing men engaged in sexual acts with girls, including a 3-year-old and a 5-year-old, and they seized more porn on thumb drives with a search warrant, court papers said. The man also had "sexual" chats with underage girls online, but there was no evidence he sought physical contact with minors.

When he pleaded guilty, the defendant said he understood the charge carried up to 10 years behind bars. Based on the specifics of his case, the federal guidelines called for a sentence of 6.5 to 8 years in prison.

But Weinstein thought that was too much time for an offender who did not make, swap or sell child porn or try to abuse children. He said the five days the man served before making bail, plus seven years of court supervision and a fine, were punishment enough.

The judge noted that the man was undergoing sex offender treatment and was deemed unlikely to relapse and that a psychiatrist testified he was not a danger to his own or other children. He also noted that the Internet has made child pornography accessible to a much wider group of Americans who might not otherwise have been exposed to it.

The man — who lost his $75,000-a-year job as a restaurant manager after his arrest — told NBC News he stumbled on child pornography while consuming legal, adult pornography online.

"I just got caught up in it," he said. "It's not like I woke up and said, 'Listen, let me look at this stuff.' It kept popping up every time I was downloading."

Weinstein is among a group of federal judges who have argued that sentencing ranges for possessing child pornography — which were doubled by Congress in 2003 — are too severe. The federal bench handed down sentences below the guidelines 45 percent of the time, the Associated Press reported in 2012.

Those who favor tougher sentences point out that while many consumers of child pornography may not never lay a hand on a child, some do. And all, they say, play a role in a system that promotes the abuse of children.

"The viewing has a market-creation effect," Cassel said. "It ends up leading inexorably to the rape of children."

I feel very remorseful. It's something that will never happen again."

Jennifer Freeman, an attorney who represents child-porn victims in efforts to obtain restitution, called Weinstein's opinion "a diatribe" and said he was using the particulars of one case to indict the entire sentencing structure.

"He's basically saying it's not worth too much punishment," she said, adding that she did not want to comment on whether the man Weinstein sentenced deserved more time than five days.

That man said that he had done something wrong and was ashamed of it but that locking him up would not have served any purpose and would have "put my family living out on the street."

"It should be illegal," he said of child pornography. "No child should be put through that process."

But he added, "I would never physically do anything. I never had even a thought of it."

Weinstein did not respond to a request for comment. Federal prosecutors said they had no comment.