An undercover police operation that had gathered compelling evidence of child abuse by a prominent MP and a member of the UK's intelligence agencies was scrapped shortly after detectives moved in to make arrests, it was claimed last night.

Police officers brought in the Liberal MP Sir Cyril Smith during an inquiry in the early 1980s which targeted properties in south London suspected of hosting sex parties involving teenage boys, but he was released within hours, according to information received by the BBC's Newsnight.

Officers were then ordered to hand over all of their evidence - including notebooks and video footage - and warned to keep quiet about the investigation or face prosecution under the Official Secrets Act.

The information has been passed to the programme by a former officer familiar with the original investigation and its closure.

Newsnight was informed of the intelligence-led operation, which it is believed began in 1981 and involved a team of undercover regional crime squad officers, including some from Yorkshire, who were based at Gilmour House - a large police headquarters in Kennington in south London.

The team targeted six or more addresses in south London.

The squad believed that boys from care homes were being provided "to order" for sex parties. Newsnight said it had been told that during a three-month secret inquiry, officers gathered a substantial amount of evidence of men abusing boys aged around 14.

Evidence included photographs and video taken from inside a flat with a hidden camera that had been installed with the help of a caretaker.

According to an account given to the BBC, Smith was seized at a property in Streatham where he had been taking part in a sex party with teenage boys. It is understood he was taken to a police station but was released that night. A desk sergeant was reprimanded for wanting to keep him in custody.

Newsnight has also been told that the squad had evidence relating to a member of Britain's intelligence agencies and two senior police officers.

The inquiry was abruptly shelved when the squad was called together at and instructed to hand over their notebooks, photographs and video footage relating to the investigation.

They were read passages from the Official Secrets Act to deter them from speaking out, it was claimed.