MI5 moles’ licence to kill is legal, a tribunal ruled yesterday.
Human rights groups had disputed the agency’s policy of letting informants murder, kidnap and torture.
They claimed it gave moles and agents protection from prosecution.
But the Investigatory Powers Tribunal (IPT)stressed there was no such immunity although it ruled by 3-2 that the power was lawful.
IPT president Lord Justice Singh said: “The events of Manchester and London in 2017 vividly underline the need for such intelligence gathering to protect the public.”
In the majority ruling, Lord Justice Singh said MI5 has "an implied power" under the Security Service Act 1989 "to engage in the activities which are the subject of the policy under challenge".
"It is important to appreciate that this does not mean that it has any power to confer immunity from liability under either the criminal law or the civil law ... on either its own officers or on agents handled by them."
ALL WHITE ON XMAS NIGHTWhite Christmas 'expected' with snow in parts in -4C DEEP FREEZE
'WE'VE DONE IT'Harry Dunn's mum breaks down as US spy's wife is charged over crash death
'SHAMEFUL'Fury as US spy's wife charged over teen's crash death refuses to return to UK
ROYAL TREATMENTPhilip, 98, 'flown to hospital' for treatment as Queen goes to Sandringham
FLOODY HELLAerial pics reveal Xmas getaway hell for 18m Brits as motorways & railways shut
HIGH AND DRYCouple spend £100k to put home on 12ft STILTS after constant flooding
"It does not purport to confer any such immunity and has no power to do so."
Announcing the decision, Lord Justice Singh said: "This case raises one of the most profound issues which can face a democratic society governed by the rule of law."
Earlier, Sir James Eadie QC, for the government, said it would be impossible for MI5 to operate without its moles “going about their business” in terror groups.