The 55-year-old singer's conviction came two hours after a jury cleared him of repeatedly sexually assaulting a 14-year-old fan. The jury at Bristol Crown Court acquitted Glitter after hearing that the alleged victim would be paid pounds 25,000 by a Sunday newspaper if the star was convicted.
But shortly after Glitter's court victory he pleaded guilty to 54 offences of making indecent photographs of children under the age of 16, part of his library of around 4,000 such pictures. Mr Justice Butterfield sentenced him to four months for each offence, to run concurrently.
The judge said Glitter, who downloaded the images from the Internet, had "in his possession photographs of little girls being bound, tortured, gagged and sexually abused in a most repellent way".
Sentencing Glitter, who was charged under his real name, Paul Francis Gadd, the judge said: "You had over 4,000 images of children. The nature of the pornographic material in this case was in my judgment of the very, very worst possible type."
He added: "One image showed a little girl who was seven or eight-years- old with her legs tied together, gagged, with her hands tied behind her back, bearing the marks, real or artificial, of a savage beating."
On his release from prison, Glitter will go on the sex offenders register and will have to notify the police of his address for seven years.
Glitter was charged after a member of staff spotted the material when the singer took his pounds 5,000 laptop computer to PC World in Bristol to be repaired.
He was arrested at the store by police and later charged with making indecent photographs of children under the age of 16 between January and November 1997.
The court heard that the collection of material stored on Glitter's machine was hardcore paedophilia. The prosecutor, John Royce, QC, said: "He had an appetite for child pornography that was completely voracious."
The court heard that Glitter had used his equipment to access web sites apparently set up to disseminate paedophile material. The star often spent up to 12 hours a day searching for child pornography.
For 20 minutes, Glitter stood in the dock at Bristol Crown Court and pleaded guilty to each one of the counts. After the first 10, the man who once boomed his songs out to adoring teenage fans could no longer voice his pleas, merely nodding in affirmation of his guilt. Glitter hung his head as he was led away to jail. As well as the prison sentence, he was ordered to pay prosecution costs amounting to around pounds 80,000.
It was a very different Gary Glitter to the man who had earlier been cleared of four charges of indecent assault and four charges of serious sexual assault against a girl aged under 16, relating to a period between 1980 and 1982,
In a gesture familiar to all his fans, the flamboyant rocker clasped his hands together and thanked the jury who had found him not guilty.
As the final of the not guilty verdicts was returned, the public gallery, packed with fans, erupted into applause, which was acknowledged by the star.
During the three day trial, in which Glitter declined to give evidence, the jury heard accusations that the singer had spent more than two years sexually abusing a girl who he had encouraged to call him "Daddy". The woman later sold the story of her relationship with Glitter to the News of the World for pounds 10,000, but stood to gain an extra pounds 25,000 if he had been convicted.
The fan, now a 34-year-old mother of three, went to the News of the World and claimed that at the age of 14, after eight years of adoration, she had met the artist and that the friendship developed into an abusive sexual relationship.