Former undercover officer Peter Francis had said he would speak to police inquiry if threat of investigation was withdrawn

A former undercover police officer who blew the whistle on a covert Scotland Yard squad has been denied immunity from prosecution for potential breaches of the Official Secrets Act.

Peter Francis had last month offered to speak to an internal police inquiry into the clandestine squad if police withdrew their threat to investigate him for breaking the act.

Francis, in testimony published by the Guardian and Channel Four's Dispatches programme in June, had said he and other undercover officers were asked to find information to discredit the campaign by the family of Stephen Lawrence to get a proper police investigation into their son's racist murder.

Francis now says that for the time being he is only prepared to give evidence under oath to a public inquiry into the undercover infiltration of political groups.

He is backed by Doreen Lawrence, the mother of the murdered teenager Stephen, who is also calling for a public inquiry as the only way to get to the truth.

She and her former husband, Neville, want an independent inquiry as they say they have no confidence in the ability of the police to investigate themselves.

The former spy, who infiltrated anti-racist campaigners in the 1990s, has disclosed details of the work of his former unit, the Special Demonstration Squad, including how the spies regularly formed sexual relationships with the targets of the surveillance and stole the identities of dead children.

The squad's infiltration of political groups between 1968 and 2008 is being investigated in an internal inquiry led by Derbyshire's chief constable, Mick Creedon.

One of his senior officers, Detective Superintendent Steve Craddock, recently wrote to Francis, saying: "You have made some significant revelations through the media and neither the Crown Prosecution Service or myself can provide immunity from prosecution for breaches of the Official Secrets Act or any other matter."

He added: "I have made the decision at this time to treat you as a witness … and hope that you are prepared to assist the inquiry."

On Wednesday, Francis told Channel Four News that currently he would only speak to a public inquiry, and would also be willing to give evidence in public to the home affairs select committee, which has been scrutinising the undercover operation.

He said: "I will only appear before a public inquiry. I'm also prepared to appear before the House of Commons select committee. I've already volunteered to do that."

He added: "My master now is no longer the police, it's the public, so I will give them all the truth on the issues."

He says that since he left the Metropolitan police 12 years ago he has been threatened on a series of occasions by Met officers with the Official Secrets Act if he spoke out.

A group of eight women who are suing Scotland Yard over their relationships with the police spies have also said they are boycotting the internal police inquiry and favour an independent or public inquiry.