The BBC is coming under intense pressure from Scotland Yard not to broadcast an investigation into the historic links between controversial News of the World reporter Mazher Mahmood and the Metropolitan Police.

A major Panorama programme scheduled for tomorrow evening explores the long-standing relationship between the mysterious journalist known as the "fake sheikh", the police and the Crown Prosecution Service.

The reputation of Mr Mahmood was severely damaged earlier this year when a prosecution of X Factor judge Tulisa Contostavlos, based on his investigation, collapsed after a judge ruled that there were strong grounds to believe the journalist had lied.

Since then, Panorama has been investigating several past prosecutions by the CPS and police based on inquiries by Mr Mahmood, who was a registered police informant and had previously claimed that his work had led to more than 250 criminal convictions – although this was revised to 94 following a subsequent inquiry into the claim.

The Panorama programme, fronted by reporter John Sweeney, was due to be broadcast last Monday and was widely advertised across the BBC. However, it was rescheduled for tomorrow evening.

Last week, the Surrey home of former Metropolitan Police Superintendent David Cook was raided by detectives from the Met's anti-corruption command, who questioned him under caution over alleged unauthorised disclosures to Panorama. Scotland Yard yesterday refused to comment on these.

At the High Court on Friday, a judge ruled against an application for an injunction against Panorama by Mr Mahmood, which would prevent them showing images of him since 5 April 2006. The judge, Sir David Eady, said that identifying the journalist would not put his family in danger.

A source with knowledge of the BBC Panorama programme said: "There aren't any legal issues now Mazher failed with his injunction, but, as always with the BBC, the pressure on a public service broadcaster with stories like these is significant. However, I am confident they will stand firm."

It is not the first time that the BBC's flagship investigative programme has caused problems for the Met over its questionable relationship with some News International staff members.

In March 2011, Panorama broadcast allegations that a senior News of the World executive hired private investigators to hack the computer of a former British Army intelligence officer. The programme spawned a new £3m Met inquiry – codenamed Operation Tuleta – which has yet to lay any charges, more than three and a half years after the pro- gramme aired.

It is also understood that the BBC came under huge pressure over the 2011 programme and negotiations had to take place between senior BBC bosses and the D-Notice committee, a liaison body with the intelligence agencies that is supposed to guard against media disclosures which could threaten national security.

While tomorrow night's documentary on Mr Mahmood is not causing quite as much consternation as the March 2011 allegations, the Attorney General has advised Panorama to reschedule it once again. In a letter to Meirion Jones, producer of Panorama, the Attorney General asked the show "to consider whether it is in the public interest for the BBC to broadcast a programme at this time. The proposed broadcast may have the potential to prejudice any trial, should Mr Mahmood be charged."

It is still unknown whether Mr Mahmood will be prosecuted in connection with the Tulisa Contostavlos case and, as he has not been charged, the Panorama documentary would not be in contempt of court. At Friday's injunction hearing, Sir David Eady said that while the Attorney General was "entitled to point out the problem that might arise if he's prosecuted, it's not grounds for the injunction as such".

The BBC's legal representative, Manuel Barca QC, argued that Mr Mahmood's injunction was just to protect "his shelf life … as a tabloid reporter".