Arshad Mahmood, 47, was told by a judge that his case was as bad as any could be.
The Recorder of Bradford, Judge Roger Thomas QC, said: "This is just a terrible, or heinous, case of its type."
Bradford Crown Court was told that Mahmood had been tried in February for a catalogue of child sex offences, but the trial had to be abandoned when he perverted the course of justice by persuading the main girl victim to change her evidence.
Married Mahmood, of Carmona Avenue, Shipley, then pleaded guilty before a retrial to raping the girl; two charges of sexual activity with a child; two of making indecent photos of a child; one of sexual activity with a person with a mental disorder; and perverting the course of justice. The charges included one of sexual activity with another girl.
He was jailed for 13 years for rape, a further three years for the sexual offence against the second girl, and a consecutive four years for perverting the course of justice.
Prosecutor Ian Brook told the court the complainant had severe learning difficulties which meant she had little idea of danger and would not understand the consequences of her actions.
Mr Brook said that when Mahmood's computer was examined it was found to have been used to search for and view 2,444 pornographic images, while 21,634 porn websites had been visited.Mr Brook said Mahmood was arrested in March 2013 after the girl made disclosures of a sexual nature to teachers at her school, which caused them "significant distress and concern for her." She made further disclosures to police.
The prosecutor said: "The primary purpose of the machine appeared to be the viewing and storing of pornographic images." He said the examiner had never seen so many images.
There were also two pornographic images depicting the girl on Mahmood's phone, which had been created when she was aged 15 and a half, and appeared to have been taken in his bedroom.
Mr Brook said Mahmood had raped the girl and touched her breasts, but when interviewed by police he claimed she made things up.
He said the girl felt cross, sad and angry when the defendant committed the offences. She had suffered severe psychological and physical affects, and although her condition was improving, she would need ongoing support to come to terms with what Mahmood had done to her.
Mahmood's barrister, Huw Edwards, said his client accepted that what he had done was "heinous" and the girl was particularly vulnerable.
But Mr Edwards said his client had accepted his guilt and was willing to comply with any requirements or programmes while in custody or on licence.
Judge Thomas said the courts had become unhappily familiar with sexual abuse, principally by men.
He said a feature of the case was the damage Mahmood had done by his repeated denials.
Judge Thomas said Mahmood had "got at" the girl, so she had a change of heart when giving evidence, by telling her to say nothing.
He told Mahmood, who had a previous conviction for indecent assault from 1997 when he put his hand up a young girl's skirt, he had an unhealthy sexual attitude.
He said the girl's description of his "disgusting" behaviour had been graphic and detailed, and "just upsetting."
Judge Thomas imposed an indefinite Sexual Harm Prevention Order, preventing contact with the girl, or other children, and ordered Mahmood to register as a sex offender for life.
Detective Constable Alison Hanson of Bradford District Safeguarding Unit, said: "The victims in this case have shown immense strength and courage in coming forward and I hope that the significant sentence handed down today provides them with some comfort and closure, following what has been a lengthy and traumatic experience.
"Safeguarding vulnerable people is at the heart of everything we do, and the passage of time is no barrier to the police investigating allegations of sexual abuse."