At 9pm on Thursday night, Ed Miliband thought he might be prime minister. By 9am his leadership of the Labour party was clearly over. He had spent the day in his Doncaster North constituency devising strategies for the coming hours – perhaps days – expecting a close result and a war of words over which party was best placed to form Britain’s next government. By the early hours it was clear that power had slipped away to the Conservative party and David Cameron.

If the more promising opinion polls on the last day had been right, Miliband might have been able to address his party with a tone of some vindication – many of the judgments he had made, often criticised and even derided by his own side, looking shrewd and ultimately rather effective.

He had wanted to expiate the ghost of past losses, in particular banishing the spectre of Neil Kinnock’s unexpected defeat in 1992. This time was meant to be different. It looks agonisingly familiar. But with stinging Scottish salt rubbed into old English wounds.

Facebook Twitter Pinterest Ed Miliband hugs his brother David Miliband after being elected the new Labour leader. Photograph: Martin Argles/The Guardian

A journey that started five years ago with a promise to bring Labour together – to avoid the civil strife that traditionally followed election defeat – risks ending where it began: contemplating electoral wilderness.

One of Miliband’s achievements as Labour leader, advertised even by those in the party who were sceptical about everything else, was an ability to preserve a semblance of unity. He charted a course between the anti-austerity activism demanded by the left and the emollient accommodation with conservative sensibilities urged on him by veterans of Tony Blair’s march to power in the mid-1990s.

Calls for Ed Miliband to resign as recriminations begin in Labour camp Read more

From the outside it looked like a tactical fudge – splitting the difference between two drastically opposed directions. But Miliband and his inner circle of advisers believed they were writing a whole new chapter of the party’s history, “turning the page” on New Labour without lurching back to an old Labour script. Britain, they thought, was ready for a centre-left politics that decried the failings of markets and stood up to monopolistic big business, without entirely abandoning commitments to budget discipline and private enterprise. Capitalism would be made more responsible, not rejected.

It was a subtle, sometimes abstract message, and Britain didn’t get it. The great danger for Labour now is that, along with the failure of Miliband’s theoretical compromise position will die the brittle harmony he managed to negotiate in the party. Even before a leadership contest is called, a battle is getting under way to apportion blame for the defeat. The left will want to pin responsibility on the residual habits of “Blairism”, while New Labour loyalists will cite an ill-judged lapse into a business-bashing left “comfort zone”.

Facebook Twitter Pinterest Ed Miliband on the final day of the Labour Party Conference in 2014. Photograph: Oli Scarff/Getty Images

That contest will be rendered all the more acute because Labour lost two separate elections: one in England and one in Scotland. Worse, it lost them both badly – although the failure to make inroads against the Tories in the south is dwarfed by the extraordinary rout in Scotland. Rival factions can each cite an electoral disaster in support of their preferred strategic departure post-Miliband. The SNP positioned themselves as a more authentic “progressive” proposition than “red Tory” Labour. When Mhairi Black, the 20-year-old student who unseated Douglas Alexander, made her victory speech, she denounced austerity, the bedroom tax and Trident. There are many on the Labour left who will hear that kind of language as proof that Miliband vacated orthodox socialist positions and paid a price for it in an epic Caledonian collapse.

Facebook Twitter Pinterest Ed Miliband in Westminster in 2010. Photograph: Christopher Furlong/Getty Images

Yet in vital marginal seats in England, Labour’s swing barely registered. In many constituencies that were high on the party’s target list, Conservative majorities increased – Swindon, North Warwickshire, Hastings. For that to have happened, voters must have had profound reservations about Miliband’s capability to run the economy: doubts that will have long pre-dated the short campaign.

Tory scare stories of a Labour-SNP deal will have aggravated jitters among undecided voters, but that kind of tactic only works when it plays to underlying weakness in the opposition offer. The New Labour argument will be that Miliband lost those seats right at the start of the parliament when he failed to reassure Middle England that its money would be safe in his hands. The “Blairite” view will be that original doubts about Miliband’s strategy are vindicated: his conviction that the centre ground of politics had shifted left is, they will say, refuted. The party has moved backwards on his watch. The anti-Blairites – represented heavily in the trade unions – will agree on that much but insist it was proximity to Tory positions that caused the rot.

To compound the confusion, Labour appears to have been badly damaged by the behaviour of former Lib Dem voters and Ukip supporters, which didn’t match Miliband’s game plan for the election. The former were meant to march loyally back to the red flag in disgust at Nick Clegg’s partnership with the Tories. The latter were due to stick to their guns in Conservative-held seats, allowing Labour in (with the help of those anti-Clegg defectors). That effect appears not to have materialised anywhere near as much as anticipated. Instead, many ex-Lib Dems loitered outside Miliband’s door but then drifted off elsewhere, while Ukippers went “home” to the Tories just as Cameron had invited them to do.

That will provoke anger in Labour circles about Miliband’s heavy strategic reliance on electoral movements quite separate from a conventional swing from blue to red – and, as it transpires, inadequate in comparison. But a repatriation of Ukip voters to the Tories (especially if it turns out that ex-Labour voters actually proved more loyal to Farage) will provoke a very difficult conversation about future directions in policy on Europe and immigration. Again, there will be diametric opposition between those who say Ukip sensitivities should be heeded and those who insist the problem was insufficiently aggressive counter-blast. That faultline won’t fall neatly along the Blairite-left axis. There are old Labour supporters who see Ukip nibbling into the party’s working-class base in the north of England and urge tougher positions in response. There are New Labourites who would pursue a line of proud internationalist liberalism. And there are shades of angst-ridden opinion in between.

Facebook Twitter Pinterest Labour leader Ed Miliband, take a selfie as he meets passengers and passers-by at Sheffield railway station before boarding a train to Leeds to host a Labour Party rally during his campaign tour Photograph: Stefan Rousseau/PA

What all sides might agree on is that Miliband’s image problems were a factor in the defeat. During the campaign he successfully rebutted a caricature of awkward ineptitude, but the switch to plausible prime ministerial candidate happened late in the day. Taken in combination with confusion about the core Labour proposition on the economy, the residue of suspicion that Miliband was simply not up to the top job must have counted against the party with wavering voters.

Yet the scale of the catastrophe that has befallen Labour reaches well beyond the leader’s difficulty in performing with easy aplomb in front of a camera. The painful reality for the party is that its leader cobbled together an inchoate platform that masked fierce ideological differences in the ranks and hoped to steer it through an electoral window opened up by Lib Dem collapse and Ukip insurgency. That gamble has failed. Twice – once in Scotland and once in England. Twin defeats could potentially pull the party in opposite directions. Then the unity that was Miliband’s clearest achievement will not survive him.