Ryan Nahirny, 35, was found out when several indecent images of children were discovered on his phone in August this year.
Nahirny, of Salcombe Road, Basford, Nottingham, had been attempting to complete an on-line form when he handed his phone to another person so they could help him.
As they attempted to add an image to the form they discovered several indecent images of children.
Police later examined various electronic devices owned by Nahirny and discovered thousands of sexual abuse images – many of them depicting the most serious offences against children.
A large number of incriminating messages to on-line chat rooms were also recovered in which Nahirny openly discussed the rape and abuse of children.
Images were also found of two identifiable victims that had been shared on line.
Nahirny pleaded guilty at an earlier hearing to two counts of sexual activity with a child under 13, three counts of distributing indecent images of children, and three counts of making indecent images of children.
Appearing at Nottingham Crown Court today he was sentenced to a total of seven years in prison. He will also have to serve a period of three years on extended licence.
In addition Nahirny will be added to the Sex Offenders’ Register for an indefinite period and will also be the subject of a Sexual Harm Prevention Order.
Detective Constable Sarah Clarke, of Nottinghamshire Police, said: “Nahirny amassed a truly horrific collection of child sexual abuse images. As our investigation progressed we discovered more than 6,000 images – more than half of which depicted the most serious sexual offences people can commit against children.
“Behind each of those images is a vulnerable child being abused in the most appalling way by adults. Sadly we know that the emotional and even physical impact of that abuse can take a devastating toll on their lives in future years.
“The offences of downloading and sharing this material are incredibly serious on their own, but sadly this offender went one step further and perpetrated his own direct abuse against children.
“I am pleased that he has now been punished for his offending and hope that today’s sentence brings some degree of comfort for his victims and their family.”