He contacted his victims on messaging applications, and when they complied with his requests, he threatened to publish what they had sent him on YouTube unless they kept providing material. He talked a few into meeting in person and then raped them.

The online abuse started in 2011, but most of the offenses in the indictment were committed from 2014 to 2016, Guro Hansson Bull, one of the three prosecutors who handled the case, said in a telephone interview in November. During that period, 470 boys and young men, ages 9 to 18, were abused. Of those, 300 — “the most severe cases,” she said — were included in the indictment. Mr. Lundin said 228 were entitled to compensation for their ordeals.

The authorities found more than 16,000 sexually explicit films of victims on the suspect’s computer.

Besides sexual assault, the defendant was accused of paying some of the boys for sexual acts, which took place in his home in Fetsund, a riverside town about 18 miles east of Oslo, and in other places nearby.

Gunhild Laerum, one of his lawyers, said that her client had cried throughout the trial.

“He has realized what he has done to his victims and what a burden he has been to society,” she said.

Ms. Laerum said any appeal, which has to be lodged within two weeks, would be based on the length of the sentence.