The secret home office papers published today show the public backlash to the savage sentencing of Richard Neville and the editors of the hippie magazine helped precipitate Scotland Yard's biggest ever anti-corruption drive in which 400 officers, including a deputy assistant commissioner, were imprisoned or left the force.

The head of the Metropolitan police's obscene publications squad, who targeted the capital's burgeoning samizdat, also ended up behind bars as had Neville and the magazine's other two editors, Felix Dennis and Jim Anderson.

The papers were not due to be made public until 2003 but have been released early under the open government initiative. They show that the then home secretary, Reginald Maudling, was so stung by the accusation that the police were singling out hippie publications such as Oz and the Little Red Schoolbook for prosecution while Soho pornographers were being let off the hook that he ordered a major inquiry.

Detective Chief Inspector George Fenwick, then in charge of the "dirty" squad, told Mr Maudling that pornography could not be stamped out because it had existed for centuries, and justified his targeting of Oz and the Little Red Schoolbook as indecent publications which were aimed at children and advocated "the alternative society".

Fenwick disputed the home office's claim that the Soho bookshops were operating with impunity. "I would rather question the assertion that pornography was on 'open sale' in Soho or indeed anywhere else in London on a large scale. I would, however, agree that it can be found in various bookshops when it is particulary asked for."

Home office civil servants said this weasel explanation "left a good deal to be desired".

Detailed allegations were made of police corruption soon after the the Oz inquiry. Fenwick was eventually jailed for 10 years as the "chief architect" of the biggest ever Met corruption ring in which the Soho porn merchants had some of the most senior police officers in Britain on their weekly payroll.

The Oz case at the Old Bailey was the longest obscenity trial in British legal history. The original sentences of up to 15 months for Neville and the others sparked a wave of protest from Beatle John Lennon, a young John Birt and many others.

The convictions were quashed on appeal only after, it is alleged by Geoffrey Robertson, one of the defence counsels, the lord chief justice, Lord Widgery, sent his clerk, a former merchant seaman, to Soho one lunchtime to buy £20 worth of the hardest porn he could find. The contents of Oz paled in comparison.

After the trial Fenwick had to explain to Maudling why he had targeted Oz. In his confidential report dated August 13, 1971, he said: "In this country at the minute there are somewhere in the region of 80 publications which advocate what in the current idiom is called the alternative society. Of these about 25 can be termed 'underground' press and a number of them contain articles which can be described as indecent.

"However, by far the worst of these are Oz, Frendz and IT, in that order. These in fact are the only ones against whom action has been taken or indeed contemplated in the last 12 months."

He said that alongside these "underground" publications so-called sex instructional literature had emerged, including the Little Red Schoolbook, Curious, In Depth, New Directions and Forum - later to feature articles by Alastair Campbell, Tony Blair's press secretary. "All have been the subjects of inquiry or prosecution by this department during the past year. It is an unfortunate fact of life that pornography has existed for centuries and it is unlikely that it can ever be stamped out."

He disputed that pornography was on open sale and complained that the way the law was drafted made his task impossible: "The police cannot act as 'buyers' and so lay themselves open to allegations of 'agent provocateur'. It must therefore be left to the purveyors of filth to make a mistake or the odd genuine complaint to come to hand."

Fenwick blamed the director of public prosecutions for lack of action and the press for giving massive publicity to the hippie cases and leaving the impression the police were doing nothing about Soho.

Fenwick's explanation set alarm bells ringing in the home office. Anxieties were reinforced when an anonymous "senior Yard man" was quoted in the London Evening News saying the Oz trial would not herald a new crackdown on porn as it would take too much manpower: "One can go into Soho today and see far worse pornography than was in the Oz magazines. Any child can buy it."

So when Matthew Oliver, an investigator for Lord Longford's unofficial inquiry into pornography, later that year produced allegations against seven named porn merchants who were bribing police officers, the home secretary demanded a full report.

The inquiries initially came up against a wall of silence.

But in February 1972 the head of the Scotland Yard flying squad, Commander Kenneth Drury, was revealed to have just spent a two-week holiday in Cyprus with James Humphreys, one of seven named porn barons. Drury claimed they were looking for Ronnie Biggs, the escaped train robber.

But investigations ordered by the new Met commissioner, Robert Mark, finally unveiled the systemic corruption at the heart of the police. Four years later Mr Justice Mars-Jones named Fenwick as the "chief architect" and sentenced him to 10 years' imprisonment.