The UK Independence Party has threatened legal action if the BBC does not allow the party to participate in Thursday's televised leaders' debate.

Party leader Lord Pearson of Rannoch has written to BBC director-general Mark Thompson arguing that the corporation is breaching its own election coverage guidelines by refusing to allow Ukip equal footing with Labour, Conservatives and the Liberal Democrats.

Lord Pearson said that if the BBC does not agree to allow him to participate in the debate by noon on Wednesday, Ukip will apply to the courts for a judicial review of the decision and injunction overturning the ruling.

Ukip's action follows similar moves by the Scottish National Party in Edinburgh, where a court today heard that the decision to exclude the SNP from the debate was "inherently unfair".

In the letter to Mr Thompson, Lord Pearson noted that the BBC had prevented Ukip from appearing on the debate because it only polled 2.2% of the national vote at the 2005 general election.

But he said Ukip had finished second with 16.5% of the popular vote at the 2009 European elections, and pointed to BBC guidelines which allowed the corporation to take account of factors such as "variations in levels of support".

"This surely constitutes compelling 'evidence of variation in levels of support in more recent elections'," he wrote. "You have allowed Labour and the Liberal Democrats to participate in the leaders' debates, though they received smaller shares of the vote than Ukip in the most recent test of national opinion, which was the European election of last year. Yet you have denied Ukip the chance to participate."

Lord Pearson also pointed to another guideline on the number of candidates, saying: "Ukip - as of today - is fielding 560 candidates, a number not far short of those fielded by the three parties whom you are allowing to participate in the leaders' debate.

"As your own guidelines say, 'The number of candidates a party is standing may also be a factor'...

"Certainly, Ukip - in the number of candidates we are fielding in this General Election - is close to parity with those parties whom you are allowing to participate."