The Tanzanian prosecutor investigating worldwide misconduct by BAE, Britain's biggest arms company, confided to US diplomats that "his life may be in danger" and senior politicians in his small African country were "untouchable".

A leaked account of what the head of Tanzania's anti-corruption bureau, Edward Hoseah, termed the "dirty deal" by BAE to sell Tanzania an overpriced radar system, is revealed in the US embassy cables.

BAE is to appear in court in London tomorrow, when their system of making secret payments to secure arms contracts, exposed by the Guardian, will be officially detailed for the first time.

Every individual involved in the BAE scandal in Britain and Tanzania has escaped prosecution.

But the arms giant agreed with the UK Serious Fraud Office (SFO) to pay £30m in corporate reparations and fines, provided the word "corruption" did not appear on the indictment. A corruption conviction would debar the company from EU contracts.

The former overseas development secretary, Clare Short, said at the time: "It was always obvious that this useless project was corrupt."

Hoseah met a US diplomat, Purnell Delly, in Dar es Salaam in July 2007, and claimed (unrealistically it turned out) he would be able to prosecute guilty individuals in the BAE case. The US cable reports: "He called the deal 'dirty' and said it involved officials from the Ministry of Defence and at least one or two senior level military officers."

Hoseah spoke gloomily about the prospects for Tanzania's anti-corruption struggle and his original hopes to prosecute the "big fish" of corruption.

"He told us point blank ... that cases against the prime minister or the president were off the table ..." The cable then details allegations against former leaders and their inner circles, saying they would be "untouchable".

"He noted that President Kikwete does not appear comfortable letting the law handle corruption cases which might implicate top-level officials." The cable then says Kwitke "does not want to set a precedent" by going after any of his predecessors.

There were "widespread rumours of corruption within the Bank of Tanzania", Hoseah said, and the island region of Zanzibar was also "rife with corruption".

The diplomat noted: "Hoseah reiterated concern for his personal security ... saying he believed his life may be in danger ... He had received threatening text messages and letters and was reminded every day that he was fighting the 'rich and powerful'."

He might have to flee the country. He warned: "He said quietly: 'If you attend meetings of the inner-circle, people want you to feel as if they have put you there. If they see that you are uncompromising, there is a risk.' "

The US embassy noted in a "cynical" aside, that probably the only reason Hoseah felt obliged to attempt a BAE prosecution was because the SFO had presented him with "a fully developed case file, brimming with detailed evidence".

Today's court appearance by BAE is the culmination of lengthy attempts to bring the company to justice since the Guardian exposed its worldwide secret payment system.

The prime minister at the time, Tony Blair, intervened in 2006 to halt an SFO investigation into payments to members of the Saudi royal family.

The US department of justice has had more success than the SFO, forcing BAE to pay $400m (£260m) in penalties under the US Foreign Corrupt Practices Act.

£28m radar deal 'stank'

Tanzania, on Africa's east coast, is one of the poorest states in the world, formerly controlled in turn by Arab slavers, German colonists and the British.

At the time of the radar deal, life expectancy was 45.

Tanzania was forced to apply for debt relief from the west and was heavily dependent on aid. It is ravaged by HIV/Aids and its GDP per head is just $723 (£465).

President Benjamin Mkapa, whose regime did the deal, was succeeded in 2004 by his political colleague Jakaya Kikwete.

Tanzania, which has no air force, bought the military air defence radar from BAE in 2001 for £28m.

It was claimed the Commander system, which was portable and festooned with anti-jamming devices, could also be used for civilian air traffic control.

The country borrowed the cost from Barclays, adding to its debt burden. Both the World Bank and the International Civil Aviation Organisation called the purchase unnecessary and overpriced.

In London, the then development secretary, Clare Short, temporarily blocked aid payments in protest. "It stank," she now says of the sale.

She urged an export licence be withheld, but was overruled by Tony Blair himself. Robin Cook, then foreign secretary, recorded bitterly in his diary that Dick Evans [of BAE] seemed to have "the key to the garden door of No 10 [Downing St]".

In January 2007 the Guardian disclosed that BAE had used an offshore front company, Red Diamond, to secretly pay £8.4m, 30% of the radar's ostensible price, into a Swiss account.

The account was controlled by Tanzanian middleman Sailesh Vithlani. His "consultancy" agreement was, it is alleged, formally signed off in London by Evans.