The UK's attorney general is planning to go to court to demand that Tony Blair should not be prosecuted for his role in the Iraq war, according to reports.

The proposed intervention from Jeremy Wright QC comes after a judge ruled in November last year that Blair had "immunity" from prosecution.

It also ruled against prosecuting the former prime minister on the grounds that pursuing prosecution could "involve details being disclosed under the Official Secrets Act", according to the Guardian.

The latest attempt to privately prosecute Blair is being brought by a former chief of staff of the Iraqi army, who is now living in exile.

The private prosecution intended to prosecute Blair, alongside his former foreign secretary and attorney general, Jack Straw and Lord Goldsmith, for the crimes of "aggression" following the findings released by the Chilcot report.

Legal documents seen by the Guardian show Wright, who is the Conservative MP for Kenilworth and Southam, had formally asked to join future hearings and for the attempt to prosecute Blair and his top aides to be rejected.

Despite previous hearings preventing the prosecution of Blair, the lawyers behind the private prosecution are seeking a new hearing to challenge that refusal and gain access to legal aid funding.

The attorney general claims that attempts to prosecute Tony Blair are hopeless, as crimes of aggression do not exist in English law, despite it existing in international law.

But Wright's argument appears to have been undermined by a memo written by his predecessor.

In his 2003 memo on the legality of the Iraq war, Goldsmith said: "Aggression is a crime under customary international law which automatically forms part of domestic law."

A spokesman for the attorney general told the Telegraph newspaper that Wright was "seeking to intervene in the case because it raises issues about the scope of criminal law".

After the Chilcot report was published, families of service personnel who died in the war called for Britain to face criminal charges.

Imran Khan, who led the last attempted prosecution against Blair, said his client was "baffled as to why it is that despite the Chilcot report making it very clear that the war was illegal, attempts are below made to prevent those responsible from entering a court, let alone being prosecuted for what they did".