The show is due to feature Mr Griffin and other panellists on 22 October.

Mr Hain wrote to the BBC's director general arguing the British National Party was "an unlawful body" after a court ruling on its membership policy.

But Mark Thompson said the court case did not "legally inhibit" the BBC from allowing Mr Griffin on the programme.

In a letter to Mr Hain the BBC chief said: "It remains the BBC's obligation to scrutinise and hold to account all elected representatives and to do so with due impartiality.

"We are also advised that if there were to be any election - local or national - tomorrow, the BNP would still be able to field candidates.

"We therefore do not agree that the developments in the Central London County Court proceedings legally inhibit the BBC from allowing Nick Griffin to participate on the Question Time programme and our position remains as set out."

'Unlawful body'

Downing Street said the prime minister did not oppose the BBC decision to have the BNP on the programme, saying Gordon Brown believed it was important to expose what a party stood for.

Number 10 also made clear Mr Brown had no problem with Mr Hain's opposition to the BBC decision, saying he had a long and distinguished history of anti-racism.

No BNP representatives have yet appeared on the BBC's flagship panel show.

But the corporation reviewed its position following the party's success in last June's European elections, in which Mr Griffin was one of two BNP candidates to be elected as an MEP.

The BBC has said it is obliged to treat all parties with "due impartiality".

But in his letter to the director general, Mr Hain, a prominent anti-apartheid activist before becoming an MP, said the decision should be reconsidered in light of a legal case about ethnic restrictions on the BNP's membership rules.

The party has agreed to amend its constitution after the Equalities and Human Rights Commission sought an injunction, claiming the BNP was breaking the Race Relations Act by restricting membership to "indigenous Caucasian" people.

Mr Hain wrote: "Now that the BNP have accepted they are at present an unlawful body, it would be perverse of you to maintain that they are just like any other democratically elected party. On their own admission, at present, they are not.

"If you do not review the decision you may run the very serious risk of legal challenge in addition to the moral objections that I make.

"In my view, your approach is unreasonable, irrational and unlawful."

Mr Hain said the invitation should be suspended until a new constitution could be agreed and the court was satisfied that the party passed "a basic threshold of legality".

Please turn on JavaScript. Media requires JavaScript to play.

Mixed reaction to the BBC's decision to invite Nick Griffin to appear on Question Time

He added: "In the meantime, surely you have no choice but to rescind the invitation and await the court's final decision on the matter?

"You are giving the BNP a legitimacy even they dare not claim in their current unlawful status."

Anti-fascist campaigners have said they will stage a demonstration against Mr Griffin's appearance on the show at the BBC's Television Centre, west London.

As well as Mr Griffin and Mr Straw, panellists are expected to include Conservative peer Baroness Warsi, Lib Dem home affairs spokesman Chris Huhne and playwright and critic Bonnie Greer.

A court heard last week that Mr Griffin had agreed to ask his party to amend its constitution so that it does not discriminate on grounds of race or religion.

BNP members will be asked to agree to the proposed changes at a meeting in November.

This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.