He had been jailed on 11 February for contempt of court after failing to disclose his financial details to a German publisher which is suing him for repayment of an advance on a book not yet written.
On an application by the publisher, Rowohlt Verlag, Mr Irving had been ordered on 20 December to set out details of his assets in an affidavit within seven days. The author was arrested at home after the hearing, which had gone ahead in his absence.
The judge, Mr Justice Brooke, had said that he was sure Mr Irving, 55, had been deliberately avoiding service of legal documents requiring the affidavit.
But Mr Irving yesterday denied this, and was released, on strict conditions, to allow him to prepare his affidavit of means.
In a written statement he told the court that because of a campaign of abuse, harassment and threats from anti-Nazi activists, he lived 'in a state of siege' and feared for his own safety and that of his girlfriend and young child.
He normally refused to identify himself to strangers in the street, on the telephone or on his flat intercom. Any mail - particularly bulky packages - that was not identifiable, remained unopened. In the past he had received mail containing 'offensive material, including manure'.
His dispute with the publishers centres on a 1985 agreement that he would deliver a biography of Winston Churchill within nine months. The historian was paid an advance of DM150,000 (about pounds 50,000) on royalties for the volumes but it was alleged he had failed to keep to the deadline for the second volume.
Mr Iving claimed that while in prison he had been exposed to a world 'one could not normally see'. He added: 'I have made a lot of friends in here, of every colour, I hasten to add.'
Asked how he had coped with prison, when he was accustomed to a more civilised life at his home in Grosvenor Square, central London, he said: 'I'm tough. They would have to do much worse than this to get me down.'