David Cameron's last hope of victory is to "puff and promote" the SNP, Ed Miliband claimed as he branded The Sun's endorsement of the Conservatives and nationalists an "unholy alliance".

The tabloid raised eyebrows as it formally backed Tories in its national edition but threw its support behind Nicola Sturgeon's party north of the border.

Mr Miliband, who won plaudits for taking on owner Rupert Murdoch over phone hacking, regularly cites him as the sort of "vested interest" he would stand up to if he finds himself in Number 10 after May 7.

The Labour leader joked: "I've worked really hard over the last four and a half years to get Rupert Murdoch's endorsement, you may not have noticed that.

"And, clearly, it is a deep disappointment that The Sun has endorsed the Conservative party.

"Although, I might add, I think it says a lot about the state of British politics that you have got the primary Tory supporting newspaper that is supporting the Conservative Party in England and supporting the SNP in Scotland.

"There can be no greater illustration of the unholy alliance of the Conservative and the SNP. And the Sun newspaper has revealed that is because what they are showing is that David Cameron's last best hope is to puff and promote the SNP in Scotland."

The Sun backed the Tories in 2010 - after supporting Tony Blair in the previous three general elections - and while The Scottish Sun did not back either side in the referendum debate last year, it supported the SNP at the 2011 Scottish parliament election.

In a nod to the imminent arrival of a royal baby, the front page showed Mr Cameron's face on a swaddled newborn under the headline It's A Tory - and said only his party could keep the economy on track, "stop the SNP running the country" and guarantee an EU referendum.

It levelled some criticism at the PM and his party for being "too aloof" and failing to raise wages sufficiently - but it said spending cuts had been "essential" to turn the economy into "the envy of the Western world".

In a dig at Mr Miliband's interview with the comedian-turned-activist Russell Brand, it said: "Conspiracy theorists like Russell Brand, the 39-year-old teenager, believe The Sun backs the Tories because we are all part of some evil elite behind every bad thing ever.

"Here's the real reason: because this time they are by far the best bet for the prosperity and happiness of millions of ordinary people who read The Sun. It really is that simple."

The Scottish Sun went with a Star Wars motif, with SNP leader Nicola Sturgeon mocked up as a light sabre-wielding Princess Leia under the headline "Stur Wars", saying she would "fight harder for Scotland's interests at Westminster, offering a new hope for our country".

Defending the apparently contradictory approaches, a Sun spokesman said: "The Sun is written first and foremost for its readers, and the UK edition and Scottish edition have two very distinct audiences.

"If Scotland and England were playing each other at football, no one would expect The Scottish Sun to support the English national team."