Britain's Army chiefs refused to go to war in Iraq amid fears over its legality just days before the British and American bombing campaign was launched, The Observer can today reveal.

The explosive new details about military doubts over the legality of the invasion are detailed in unpublished legal documents in the case of Katharine Gun, the intelligence officer dramatically freed last week after Lord Goldsmith, the Attorney-General, dropped charges against her of breaking the Official Secrets Act.

The disclosure came as it also emerged that Goldsmith was forced hastily to redraft his legal advice to Tony Blair to give an 'unequivocal' assurance to the armed forces that the conflict would not be illegal.

Refusing to commit troops already stationed in Kuwait, senior military leaders were adamant that war could not begin until they were satisfied that neither they nor their men could be tried. Some 10 days later, Britain and America began the campaign.

Goldsmith also wrote to Blair at the end of January voicing concerns that the war might be illegal without a second resolution from the United Nations. Opposition MPs seized on The Observer's revelations last night, accusing Goldsmith of caving in to political pressure from the Prime Minister to change his legal advice on the eve of war.

Senior Whitehall sources involved in putting together critical legal advice on the war told The Observer that Goldsmith was originally 'sitting on the fence' and that his initial advice was 'prevaricating'. This was 'tightened' up only days before the conflict began after concerns were raised by Sir Michael Boyce, the then Chief of Defence Staff, who told senior ministers of his worries. It is believed that Boyce demanded an unequivocal statement that the invasion of Iraq was lawful. It is understood that it was only after seeing Goldsmith's final legal advice, given days before the outbreak of war, that Boyce gave his approval.

Without this legal reassurace, military leaders and their troops could have laid themselves open to charges of war crimes. At the time, UK troops were already in Kuwait poised for an invasion.

Last week, Goldsmith controversially agreed to drop the Government's prosecution of the former GCHQ whistleblower Katharine Gun. Her defence had demanded documents relating to his legal advice, including communications with the Prime Minister.

Although Goldsmith denied his decision to drop the case was political, critics of the war believe the Government was desperate to prevent these details from being revealed in open court.

Menzies Campbell, Liberal Democrat Foreign Affairs spokesman, said: 'These allegations go to the very heart of the Government's case for war, and inevitably its credibility. I have no doubt whatever that if Parliament had been told these things, the Government would not have achieved its majority and been unable to go to war. Public opinion, already deeply divided, would have swung overwhelmingly against the Government.'

Opposition MPs have demanded a statement in the Commons from the Prime Minister and will redouble the pressure for an explanation. The revelations will also increase pressure for the Butler inquiry, set up by the Prime Minister into intelli gence in the run-up to the war, to study the Gun case and subsequent revelations. It will take evidence in private.

Last night former Cabinet Minister Clare Short told The Observer that she knew of military doubts over the legality the war: 'I was told at the highest level in the department that the military were saying they wouldn't go, whatever the PM said, with out the Attorney-General's advice. The question is: was the AG lent on?

'This was a very personal operation by Tony Blair. The Attorney-General is a friend of Tony's, put in the Lords by Tony and made Attorney-General by Tony.'

The Observer has also established that GCHQ, the Government's top-secret surveillance centre, has a specialist unit dedicated to spying on the UN. The revelation will strengthen claims that the bugging of Britain's diplomatic allies at the UN was routine and is likely to trigger a fresh international furore over the legality of Britain's spying operations abroad.

The former Chilean ambassador to the UN, Juan Gabriel Valdes, said last night: 'All I can say is what I said at the time when asked if I had information about spying on Chile and I said yes, it has been proved.

'It [eavesdropping] was one more element of tension during some very tense weeks. Nobody was very surprised. But it is one thing not to be surprised and another to do clearly illegal things.'

Gun leaked a top-secret email published in The Observer last March revealing a joint British-American operation to spy on the UN in the run-up to war. She claimed she acted to prevent the loss of human life in an illegal war.

The political furore continued as Short's political future remains in the balance, with the Prime Minister reserving a final decision until he has seen the round of interviews she has planned for this weekend. 'Everyone has talked about the fact that they don't want her to be a martyr, but of course the only difficulty is that we are in her hands - what will she say tomorrow?' said one senior party figure.

However, it remains highly unlikely that she will face an organised attempt to unseat her, because of the months of upheaval it would cause in the Labour party. 'The pain of extraction might finish off the patient,' said one backbencher far from loyal to Short.

Downing Street last night refused to comment on the allegations. Blair's spokesman also refused to say whether the White House had been consulted over the dropping of the Gun case, despite growing conviction at Westminster that it would have been inconceivable for the Foreign Office not to have taken its closest ally's views into consideration.

Despite Blair's refusal to give a statement to the Commons, the Government is unlikely to escape further questioning. Both Jack Straw, the Foreign Secretary, and Geoff Hoon, the Defence Secretary, are already due to answer questions next week while the Home Secretary, David Blunkett, will be grilled by a joint Commons inquiry into homeland security. Labour and Opposition MPs have also tabled a string of written questions.