Image caption The Stig has never removed his helmet on the show

A court case to prevent the identity of Top Gear's The Stig from being revealed is to continue being heard in private.

The judge at the High Court said the case should proceed behind closed doors, as publicity would defeat the purpose of the hearing.

The BBC began legal action last week to block HarperCollins from publishing an autobiography which would unmask the character.

It says the planned book would breach confidentiality obligations.

Arguing for HarperCollins, Hugh Tomlinson QC said the press and public should be allowed to hear the legal arguments.

He added the press could be subject to extensive restrictions to prevent any confidential information being revealed before the conclusion of the case.

But Mr Justice Morgan said: "It seems to me that having the hearing in private is a much more effective barrier to information which might in due course be the subject of an injunction passing more widely into the public domain."

He said the public interest in "having justice in open court for all to hear" could be dealt with by a public judgment given "in due course".

Last week, HarperCollins said it would "vigorously defend" its right to publish the book, adding it was "disappointed that the BBC has chosen to spend licence fee payers' money to suppress this book".

However Top Gear executive producer Andy Wilman attacked the publisher, writing on the Top Gear website that the BBC had a right to protect Stig's anonymity "from a bunch of chancers" who were "hoping to cash in on it".

The BBC has never confirmed the identity of The Stig - who test drives cars on the show. It maintains that unmasking him would spoil viewers' enjoyment.