An attempt by the Scottish National Party to use the courts to ban the broadcast in Scotland of Thursday's BBC TV prime ministerial debate has failed.
The party asked the Court of Session in Edinburgh to rule on whether the corporation had breached its rules on impartiality by excluding the SNP.
But this was dismissed by the judge, Lady Smith, after a two-day hearing.
The SNP's deputy leader Nicola Sturgeon said the party was "disappointed" with the decision of the court.
Thursday's debate in Birmingham will feature Gordon Brown, David Cameron and Nick Clegg.
It is the third and final debate featuring the leaders of Labour, the Conservatives and the Liberal Democrats.
Debates have been held on ITV and Sky on the previous two Thursdays.
The court papers stated the SNP was seeking an interim interdict against the BBC broadcasting the leaders' debate in Scotland if it did not feature the SNP.
In her written ruling on the case, Lady Smith stated the SNP's case "lacks the requisite precision and clarity" and added she could not conclude the BBC had breached impartiality rules.
The series of leadership election debates is now two-thirds of the way through and has, thus far, taken place according to plan
Lady Smith Judge
Speaking outside the court, Ms Sturgeon said: "We are disappointed that the debate on Thursday night will go ahead without any substantial participation from the SNP.
"We believe it is wrong and unfair and all the points we have made until now still stand.
"We were simply asking for a fair hearing.
"We will now take our case to the court of public opinion."
The SNP raised £50,000 to pay for the legal process.
It said it was not trying to stop the broadcast but that the inclusion of an SNP politician was "a simple argument for fairness".
The BBC's lawyer Gerry Moynihan QC said the action was "completely contrary" to the public interest.
He argued that the SNP had failed to take into account that, as well as being shown on BBC One, the debate will also be broadcast on the radio, the internet and Sky.
The QC told the court the Nationalists had a "considerable problem" in relation to the timing of the action, claiming they had "stood idly by" when the two earlier debates were held.
Ms Sturgeon said she estimated the TV debate would be watched by about one million people in Scotland.
She said the SNP planned to distribute one million leaflets over the weekend which display a BBC test card transmission saying: "Except for viewers in Scotland."
The SNP deputy leader added that while the party's application for an interdict to stop the broadcast had been rejected, its request for a "judicial review" of the BBC's decision to exclude the SNP had progressed.
It will be heard by the court at a later date.
In her ruling, Lady Smith said of the BBC: "The information before me shows that they have planned coverage of the petitioners' campaign, in particular, at the present time, which appears to be of substance and cannot be said to be lacking in impartiality."
His use of the legal process, for what has been no more than a £50,000 SNP campaign stunt, is desperate stuff.
David McLetchie Scottish Conservatives
The judge went on to say delay was "particularly significant" in the case.
"Whether one compares the debates to three rounds of a boxing competition, a three course meal, a play in three parts or any similar convenient analogy, the planned event is that the series of leadership election debates is now two-thirds of the way through and has, thus far, taken place according to plan," Lady Smith stated.
"The order the petitioners seek would, whatever happens, result in wholesale disruption of that plan.
"It would deprive the public, probably the whole of the UK public, who are anticipating being able to complete their viewing and consideration of the whole series of debates tomorrow, of the opportunity to do so."
The ruling continued: "It would, on the face of matters, leave them with an incomplete picture. That would hardly accord with proper, well-ordered administration."
Responding to the decision, Iain Gray, the Scottish Labour leader, said: "This was a desperate attention-seeking stunt by a party who have nothing to say in this election, but it ended in humiliating failure for Alex Salmond.
"He must be the only person in Britain who thinks this election is about how many times he appears on television."
Scottish Tory campaign manager David McLetchie said: "The SNP knew the UK leaders' debates would get significant press coverage but Alex Salmond waited till now to go to court to ensure maximum coverage during the campaign.
"His use of the legal process, for what has been no more than a £50,000 SNP campaign stunt, is desperate stuff. The ruling just proves this point."
Liberal Democrat Alistair Carmichael said: "The court's decision is the right one. The SNP has wasted taxpayers' money and everyone's time on this court case."
Meanwhile, broadcasting regulator Ofcom has announced it has not upheld complaints received from the SNP and Plaid Cymru about The First Election Debate broadcast on ITV1 on Thursday 15 April 2010.
The political parties complained that the programme was not impartial and was also misleading.
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.