Gordon Brown was still asleep when, just after 10 p.m., the BBC broadcast its exit poll projecting a hung parliament with the Tories nineteen seats short of an overall majority.

This was better for Labour than anticipated by most of the party’s own campaign team, let alone the media. Cheering erupted in the party’s Victoria Street headquarters. David Muir, one of Gordon’s key strategists, hugged the party’s veteran pollster Philip Gould, ‘it is so good’.

Everyone thought the exit poll underestimated the Lib Dems. Surely they weren’t going down from sixty-four to fifty-nine seats after three weeks of Cleggmania following the first TV debate between the party leaders? But if the Lib Dems were doing better than fifty-nine, then the 307 projected for the Tories might be an over-estimate, pulling them even further from the magic 326 needed for an overall majority and giving Labour, projected at 255 seats, a chance of a majority with the Lib Dems.

So it was in a mood of optimistic uncertainty that, shortly before 11 p.m., Gordon’s aides who had finished the campaign with him in Scotland at a boisterous rally in Kirkcaldy on Wednesday night – including Sue Nye, his longest-serving aide; Justin Forsyth and Iain Bundred, his media staff; Kirsty McNeill, his speechwriter; and Stewart Wood, a policy adviser – headed from the King Malcolm Hotel to his detached red-brick constituency home on the hilltop overlooking North Queensferry and the Firth of Forth.

When they arrived the only person downstairs was Sarah Brown, watching a film. ‘I suppose we had better get moving,’ she remarked laconically as she went upstairs to wake Gordon. The team set up in the dining room to make calls while awaiting the first constituency results. These were late coming through because of the increased turnout which led to long queues and voters being turned away when polling stations closed at 10 p.m.

The first results after 11 p.m., from Sunderland in Labour’s north-eastern heartland, painted a confused picture. The swings against Labour were 8.4 per cent and 11.5 per cent in the first two – very safe Labour – seats to be declared, but less than 5 per cent in Sunderland Central, the constituency competitive with the Tories, which Labour held. A swing to the Tories of less than 5 per cent in marginal seats was hung parliament territory. This picture of differential swings, with sitting Labour MPs in tight fights with the Tories often keeping the swing down and holding their seats, soon became a recurring pattern. So after an initial flurry that it was all over, the mood shifted to watching and waiting in the hope that the exit poll was right after all.

As expected, the Tories tried at the outset to ‘do a Salmond’. George Osborne, Michael Gove and other Tory talking heads kept repeating the mantra that Labour was heading for its ‘worst result since 1931’ and had been overwhelmingly rejected. But the Salmond strategy fizzled around 1 a.m. as Labour holds were declared or predicted in weathervane seats like Gedling in Nottinghamshire, Telford in Shropshire, Bolton North-East in Greater Manchester and Tooting in South London, with remarkably strong Labour performances across Scotland and North Wales. The BBC held to its projection of a hung parliament with the Tories a good way short of a majority and the likelihood of inter-party negotiations to follow.

The prime ministerial convoy left Ferryhills Road at midnight for the half-hour journey to Gordon Brown’s constituency count at Kirkcaldy’s Adam Smith College. Gordon was working in the back of the car on the critical passage of his acceptance speech on the national picture.

‘It’s all up in the air,’ he said, calling from the car.

We discussed emerging hung parliament scenarios. If the Tories did no better than the exit poll’s 307, we should explore a coalition with the Lib Dems.

‘The key thing’, I said, ‘is to be clear that you have no option here. It’s your duty now to ensure orderly talks between the parties, leading if possible to a sustainable government commanding a majority.’

We rehearsed different lines and settled on the imperative for ‘strong, stable and principled government’ – ‘strong and stable’ meaning a coalition, not a minority Tory government, and ‘principled’ implying an agreement between like-minded parties, i.e. Labour and the Lib Dems. These were the key words in Gordon’s constituency declaration speech at 1.30 a.m., which ran throughout the overnight election coverage thereafter.

The next move in the chess game was David Cameron’s speech at his Witney constituency declaration at 3 a.m. He struck an uncertain note, deliberately so, I thought. Although Labour had ‘lost its mandate to govern’ and the Tories were ‘on target to win more seats than in the last eighty years’, he did not call for Gordon Brown’s immediate resignation and he suggested that it could be a while before a new government emerged. ‘What will guide me in the hours ahead – and perhaps longer than hours ahead – is to do what is right for our country … At all times I will put the national interest first to make sure we have good, strong, stable government for our country.’

‘It’s certainly not an immediate Salmond strategy,’ I said to GB when we next spoke. ‘I wonder whether he’s also thinking of a play for the Lib Dems.’

Surrounding GB’s constituency declaration was a ‘purple patch’ of good Labour results which lasted for another hour or so. By now Scotland, amazingly, was showing an overall swing to Labour.

It was thus a fairly buoyant Team Brown which headed from his count to the Labour celebration at a local community centre. So much so that as he arrived, a mobile phone call to Peter Robinson – the Northern Ireland DUP leader, who lost his East Belfast seat on a massive hostile swing in the wake of his wife Iris’s affairs – had to be aborted because of whooping and cheering at the defeat of Willie Rennie, the Lib Dem who had won a by-election in the neighbouring seat to Gordon’s in Dunfermline & West Fife. Gordon retreated to a cupboard behind the reception to convey his personal regrets to Robinson, and reassurances of his continued confidence in his leadership of the Northern Ireland Assembly.

Shortly before 3 a.m. the prime ministerial convoy left for Edinburgh Airport and the flight to London. Planning for the morning started in earnest.

‘I need you all in No. 10 in the morning,’ Gordon said to Stewart Wood. ‘It’s business as usual, and we need to get talks going with the Liberals as soon as possible.’ (He always referred to ‘the Liberals’ never ‘the Lib Dems’, which annoyed Nick Clegg and other Lib Dems.)

The ‘immediate resignation’ statement – one of three which Kirsty McNeill had drafted on her laptop – was left untouched. Work started instead on a statement opening negotiations with the Lib Dems. (This was another Gordon Brown characteristic: always to be working on the text of his next speech or statement. It did not cease until moments before his final resignation speech five days later.)

Bad results were coming in with the good. Just before mobiles had to be switched off on the plane for take-off at 3.30 a.m., there were reports of several narrow defeats. ‘That’s bad organisation on the ground, that is,’ GB snapped in irritation. But he remained confident and gave an upbeat briefing to journalists at the back of the plane. ‘I have been through a lot in my political career and my personal life,’ he told them. ‘I am used to difficulty. Difficulty is not an excuse for failure. But difficulty does not set you back. It is what prompts you to move forward with more determination … What is clear is that the expectations of the Conservative Party have not been met.’

When mobiles were switched on again as the plane taxied to a stand at Stansted an hour later, the bad news was uppermost. A Tory swathe was being cut through the East and West Midlands and southern England. A succession of Lib Dems – in their more rural and slower to count constituencies – were also falling to the Tories, starting to bear out the exit poll in that decisive respect.

It looked to be slipping away after all. On landing, Justin Forsyth immediately tweeted: ‘Just landed back in London. Lots of results coming in. But picture still not clear. Gordon focused on stable, strong and principled gov.’ But GB himself looked crestfallen – ‘the only time I remember him like this in the whole election’, said one aide. ‘He wasn’t angry as at Rochdale [after his inadvertently recorded ‘bigot’ remarks about Mrs Duffy], but he clearly thought the game was up, and so did we.’

‘Our problem is that the Liberals are just too weak against the Tories,’ Gordon said to me on the phone as his convoy left Stansted. ‘I always knew this would be our big problem – not all that Guardian stuff about Clegg coming second – which is why I wanted to do that deal with them,’ he added. He was referring to his pre-election idea of standing Labour candidates down in thirty Lib Dem–Conservative marginals, a suggestion rebuffed strongly by his campaign team in the days immediately before the election.

The mood wasn’t lightened by the convoy getting lost on the journey into London, taking the wrong exit off the A13 at Royal Docks and having to go the whole way round a roundabout to double back, under the whirring gaze of the ever-present media helicopter.

However, as London approached and the sun rose, the news brightened. London results were starting to come through, and these were surprisingly good. Andy Slaughter held on with a relatively small swing against Labour in Hammersmith, as did Gareth Thomas in Harrow. Gisela Stuart’s spectacular hold in Birmingham Edgbaston was a further tonic. Cabinet ministers Ed Balls, John Denham and Ben Bradshaw all survived in seats that could easily have gone Tory. By the time Gordon arrived in Victoria Street at 5.30 a.m., to be clapped in by Peter Mandelson, Alastair Campbell, Harriet Harman and the party staff, it was possibly game on again.

After a short speech of thanks to party workers, GB decamped to a side office with Peter, Alastair and the party’s pollster, Greg Cook. The room was strewn with half-eaten takeaway meals and overnight debris.

‘The key thing is that we and the Liberals have got more seats than the Tories,’ said Gordon. ‘Is that going to continue to be the case?’ he asked Greg.

‘It looks like it,’ said Greg. ‘It’s looking like 313 at least for Labour plus the Lib Dems, with the Tories on low 300s.’

‘In that case, we need to get going with Clegg; we’ll be fine with the minor parties,’ said Gordon.

Peter was downbeat and dejected. But as Gordon went through the numbers – ‘we can absolutely do this, Peter’ – he came round to the possibility. ‘But Nick Clegg will be very bruised by this result, you are going to have to treat him very carefully,’ Peter cautioned.

It was agreed that Peter would head to the studios to do a round of interviews keeping Gordon and Labour in play. Gordon would go back to No. 10, making no further statement, to catch some sleep while his aides re-established his office for the morning to come.

While Gordon was driven back to No. 10, filmed entering through the front door, key members of his staff entered through the 70 Whitehall entrance to the Cabinet Office, which leads to a back entrance to No. 10. Gavin Kelly, Nick Pearce, David Muir and Joe Irvine ‘had practically to break into No. 10’, one of them recalled. The government car bringing in Jeremy Heywood, the ubiquitous, brilliant linchpin of Downing Street’s official machine, was late. A doorkeeper, a duty clerk and a messenger constituted the nerve centre of government at 7 a.m.

When the four aides entered the large open-plan ‘war room’ in No. 10, they found that their desks had been moved. When they tried to log onto the No. 10 computer system, their user accounts had been deleted. They officially existed no more. ‘The King is dead; long live the King’, one of them muttered.

But perhaps the King was not yet dead after all. They plugged in their portable laptops and printers and got to work.

‘Is a deal still possible?’ Nick Robinson texted me at 3.26 a.m. ‘I assume phones are already buzzing between parties.’

‘Everything looks possible’, I texted back.

But as yet there was no buzzing of phones between Labour and the Lib Dems, at least. While GB and entourage were closeted in Victoria Street discussing the realm of the possible, I was heading to White City for ninety minutes with Jeremy Paxman, saying as little as possible beyond the need for ‘a strong, stable and principled government’.

Escaping at 6.20 a.m., I phoned Danny Alexander, not having replied to his text the previous evening. He was going through security at Inverness Airport (‘I’ve got to surrender this phone imminently, even if you’re still Transport Secretary’), on his way from his constituency to London, and called back ten minutes later.

I said Gordon was ready to start talks whenever Nick Clegg was ready, and we hoped it could be in parallel with any Tory discussions. Danny was reassuring. ‘We are licking our wounds and Nick isn’t planning to say anything much apart from thanking party workers at Cowley Street [the Lib Dems’ London headquarters] until all the results are in at lunchtime.’ I said that GB wasn’t planning to say anything substantive either until there had been further contact later in the morning.

The position nonetheless looked precarious. Paddy called at 9.10 a.m. to cancel our meeting scheduled for 10 a.m.

‘I need to be with my guys,’ he said with typical brusqueness. ‘The problem is the numbers don’t seem to be there for the two of us to do business.’

I didn’t demur, except to say that it was too soon to be sure and we needed to take stock when we got the final numbers.

‘OK, let’s think about it further and speak later.’

A similar call followed from David Laws, still in Yeovil. David and I had first met when helping, for our respective parties, to negotiate the Lab–Lib coalition which took office after the first Scottish Parliament elections in 1999. Since then, through a long spell when he was my shadow at Education, we had become friends.

‘It all looks pretty difficult,’ David said.

I pushed back harder than with Paddy. ‘But won’t it be harder for you to prop up the Tories?’

‘I’m not sure that’s right,’ he responded immediately, having clearly considered this. ‘If we go in with you, in a precarious numbers game, and it all collapses in a mess, then we may be worse off than letting the Tories come in and trying to control them.’

‘But David, they’re the Tories, and how are you going to control them?’

‘I know, I know. But it may be the best course open to us.’

Again we agreed to stay in touch and I set off for the war room in No. 10.

Although fully part of the No. 10 rabbit warren of state rooms, private apartments and working offices, Gordon Brown’s large war room – as everyone called it – was geographically in No. 12 Downing Street, the next ‘house’ along the street from the Chancellor’s at No. 11. No. 12 has a front door onto Downing Street, but this is unused and it is reached by a connecting corridor from the front hallway of No. 10, passing through the narrow hallway of No. 11. The doors between the three houses were kept open.

The light wood-panelled conference room in No. 12 is by far the largest of the working offices in Downing Street, occupying almost the entire ground floor of the building as viewed from the rear gates of Downing Street opening onto Horse Guards Road and St James’s Park. For decades it had been the sparsely used office of the government whips until Alastair Campbell annexed it for his expanding No. 10 media operation during Tony Blair’s second term. Alastair took for himself the elegant wood-panelled corner office overlooking St James’s Park on one side and the walled Downing Street garden on the other, which had been the Chief Whip’s office, while his cohorts were massed in the conference room next door.

Gordon got the idea of ‘going open-plan’ from Mayor Michael Bloomberg of New York, who ran both his media empire and New York this way and swore by its positive impact on team building, information sharing and the rapid taking and implementation of decisions. Gordon moved out of the study next to the Cabinet Room, the ‘den’ which Tony Blair had used as his office for most of his three terms, with its famous sofas, and relocated to the No. 12 open-plan together with his private secretaries, duty clerks and key political and media advisers, most of whom had previously been spread out in poky offices on various floors of No. 10.

Gordon’s own desk was in the centre of a horseshoe of desks facing out from the long side of the war room, close to the doorway leading into Alastair’s old office, which Gordon used for more private meetings and phone calls. However, he was usually to be found in the open-plan, Jeremy Heywood at the desk to his left and Justin Forsyth to the right. When not in conversation with staff or on the phone, he would be sending or reading emails, or tapping away at draft speeches or statements in large block capitals visible to those passing behind. For those sitting at the desks in front, a large forehead protruding from a PC was the view of the Prime Minister. Behind him, above, was a giant TV screen with Sky News on constant feed, facing a screen on the opposite wall set to BBC News 24. One aide likened the scene to the bridge of the Starship Enterprise.

The ‘war room’ was teeming when I arrived at 10 a.m. Gordon had just come down from his flat after a two-hour nap, hair dishevelled, shirt open, but the liveliest politician in the room. (He became more so as the rest of us flagged.) Peter Mandelson was back from his media round. Alastair Campbell was standing by Gordon’s desk (‘Well, home from home – and all at the beck and call of your pesky Liberals,’ his cheery greeting). Jeremy Heywood was in hushed phone conversation at his desk, as for much of the next five days, often with the Queen’s Private Secretary at the Palace or with Sir Gus O’Donnell, the Cabinet Secretary, who was located in the Cabinet Office but ventured periodically through the maze of interconnecting corridors and security-controlled doors to visit the war room.

We debated Clegg’s and Cameron’s likely first moves.

Gordon was insistent: ‘We’ve got to get this going with the Liberals – there’s got to be movement today and something settled over the weekend or Cameron will simply take possession.’

His first public step, taken shortly after 10 a.m., was an official government statement that he had instructed the Cabinet Secretary ‘to arrange for civil servants to provide support for parties engaged in discussion’. This followed the Cabinet Office guidelines on procedure in a hung parliament, which Gus O’Donnell had framed in February in collaboration with Christopher Geidt, the Queen’s Private Secretary, and constitutional experts.

Widely publicised at the time, these guidelines were intended to condition expectations against a sitting Prime Minister resigning after the election unless and until it was clear, through negotiations with other parties as necessary, that he could not command a Commons majority but the Leader of the Opposition could do so. By explicitly stating that the sitting Prime Minister should remain in office while inter-party talks took place and until a conclusion was reached which could be recommended by him to the Queen, the aim was to keep the Palace clear of controversy and create the space for orderly negotiations. The guidelines served this purpose pretty well in the five days ahead.

This initial statement was briefed and reported as signifying that Gordon would not be resigning imminently, although no longer leader of the largest party. There was no immediate push back from the Tories. Indeed there was no word from the Conservatives at all. David Cameron, we presumed, was holed up debating next steps, much as we were.

This statement out, Gordon started calculating ‘the numbers’ on a jotter pad in his thick black felt-tip pen. ‘The numbers’ – the tally of MPs supporting different possible combinations in the House of Commons – were to be a constant refrain of the next five days.

By Friday lunchtime the final tally of seats by party was to be: Conservative 306 (plus one likely Tory seat to be filled at a separate election), Labour 258, Lib Dem 57 and others 28 – almost identical to the exit poll those fifteen long hours before.

So there wasn’t an overall Lab–Lib majority to be had. The Lab–Lib total was 315; an overall majority 326. On Friday morning almost everyone’s first reaction to this emerging picture – including those of us in the war room – was that therefore only a ‘rainbow alliance’ of virtually everyone besides the Tories could keep David Cameron out. And that the grubby deals necessary with the Scots and Welsh Nationalists, and the various Ulster parties, put this idea beyond the pale.

But by 10.30, GB had deconstructed the projected numbers to produce a different and radically more positive picture.

Gordon’s premise was that virtually all the minor-party MPs would either support Labour or abstain on confidence and other critical votes, without the need for deals, grubby or otherwise.

For the vital initial vote on the Queen’s Speech, a Lab–Lib government would command (on the basis of the final tally of numbers) between 330 and 338 votes, with only the Tories’ 307 against, giving a comfortable majority of between twenty-three and thirty-one. Also, for working purposes the majority threshold was not 326 but 322 or 323, once the Speaker, his deputies and the five absent Sinn Fein MPs were factored in. So the Lab–Lib 315 would not only outvote the Tories’ 307, but was enough to control ordinary business, on realistic assumptions about the behaviour of the smaller parties, including the steady support likely to be forthcoming from the five SDLP, Alliance and Independent members from Northern Ireland, who were either soulmates of the Left or instinctively hostile to the Tories.

As Gordon set out his view of ‘the numbers’, it sounded plausible.

The nine Scottish and Welsh Nationalist MPs, he put it bluntly, ‘would not dare vote against us; they’d be killed in Scotland and Wales in next year’s elections [for the Scottish Parliament and the Welsh Assembly] if they put the Tories in’. As he would often put it over the coming days, ‘The SNP still haven’t recovered from putting in Thatcher in 1979 and this election was fought in Scotland as if Thatcher was about to come to power again.’ Both the SNP and Plaid Cymru made statements later on Friday supporting this view. The new Green MP, Caroline Lucas, was also naturally anti-Tory. Then there were the five naturally pro-Labour Ulster MPs.

As for Ulster’s nine DUP members, they were at daggers drawn with the Tories over David Cameron’s decision to forge an alliance between the Tories and the Ulster Unionist Party to fight the DUP. The 2010 election was the first time the Conservatives had mobilised in Ulster since the Official Unionist Party severed its link with the Tories back in the Heath era in the 1970s. By contrast, GB had built good relations with Peter Robinson and the DUP over years of patient peace-process diplomacy. Shaun Woodward, the Northern Ireland Secretary, said that Robinson would be supportive without any formal deal, ‘subject to the usual arguments about money, but we have those in any event’.

We wrote down the new numbers. ‘This gives us a serious play,’ Peter agreed. ‘The numbers’ became the opening gambit in countless conversations to come about Lab–Libbery.

None of us thought it would be easy. Alex Salmond’s six SNP MPs would be relentlessly opportunist. As for the Lab–Lib core of 315, this was fine if our MPs were united and hungry for power, but thirteen years on from ‘glad confident morning’, serial malcontents were a constant problem. ‘We’ve had knife-edge votes every few weeks with a paper majority of fifty, so how do we keep this show on the road?’ said one aide, weary from years of backbench arm-twisting.

There was also the ‘Gordon issue’, as it was euphemistically termed in the inner circle. On the Friday, no one knew how this was to be resolved. But everyone knew that an arrangement with the Lib Dems was impossible unless it was.

However, all depended on whether the Lib Dems wanted to engage with us in the first place. If they did, a stark choice could immediately be presented to Labour MPs: do we seek to govern with willing Lib Dem partners, or do we hand the country over to the Tories gratuitously? ‘It’s a strange idea that the way to gain power is to give it away; the Tories never make that mistake,’ was my line. When formal discussions with the Lib Dems finally started on Day Four (Monday evening), and both the Cabinet and the party’s National Executive Committee debated this fundamental issue, there was little dissent to the principle of engagement.

But from the Lib Dems on that Friday morning of Day One came ominous silence.

Danny Alexander hadn’t got back to Peter or to me with any suggested first step, and he wasn’t returning calls. As we discussed options, a news alert flashed across Sky News. Nick Clegg would make a statement when he arrived at the Lib Dems’ Cowley Street HQ from his Sheffield constituency at about 10.30 a.m.

I relayed my 7 a.m. conversation with Danny: he didn’t think Clegg would say anything much until all the results were in. ‘Why big it up as a statement then?’ said Gordon. Why indeed? Anticipation mounted as a media helicopter tracked the Lib Dem leader’s car from St Pancras station to Westminster.

Nick Clegg’s statement, delivered noteless and tired, was a decisive opening towards the Conservatives. He restated in terms his election campaign statement that ‘whichever party gets the most votes and the most seats, if not an absolute majority, has the first right to seek to govern’, and went on: ‘I think it is now for the Conservative Party to prove that it is capable of seeking to govern in the national interest.’

Barely had Clegg finished than another news alert flashed across the screen: David Cameron would make a statement at 2.30 p.m.

Our immediate assumption was that these statements were not co-ordinated. We expected Cameron at 2.30, with the results complete, to call on GB to make way for a Conservative government. He would then reach whatever accommodation he could with the Lib Dems and the other parties.

‘I’ve got to make a statement before Cameron,’ said Gordon, watching the unfolding news on Sky. ‘We’ve got to forestall him simply claiming power, and set out an expectation that there will now be talks between the parties. And we’ve got to get a process started with Clegg today.’

We rapidly decided on GB making a statement at 1.30 p.m. GB’s concern was to demonstrate that he was still governing, dealing with the crisis over Greece and the euro (‘I need to speak to Alistair [Darling], and then to Sarkozy, Trichet [President of the European Central Bank], and Strauss-Kahn [managing director of the International Monetary Fund]’, he instructed a Private Secretary), and to say that he intended to speak to Clegg.

Gordon also needed to rise above the fray in his constitutional duty to pave the way for a new government. He had therefore to respect the right of Clegg to speak first to Cameron. We decided to state this in terms (‘I understand and completely respect the position of Mr Clegg in stating that he wishes first to make contact with the leader of the Conservative Party’), and to make a virtue of this as the first stage in a process (‘Mr Cameron and Mr Clegg should clearly be entitled to take as much time as they feel necessary’) which we hoped would lead rapidly on to Lab–Lib talks (‘clearly, should the discussions between Mr Cameron and Mr Clegg come to nothing, then I would of course be prepared to discuss with Mr Clegg the areas where there may be some measure of agreement between our two parties’), highlighting in particular economic strategy and a referendum on electoral reform, where we thought we were at one with the Lib Dems. The statement ended with a restatement of the ‘strong, stable and principled’ government theme of the night before.

The difficulty was not in deciding the content of the statement but where and how it should be delivered. Should he deliver it in No. 10 as Prime Minister or in Victoria Street as Leader of the Labour Party? Gordon wanted to do it in the state rooms of No. 10 with an autocue. But word came from Gus O’Donnell, by emissary, that he didn’t think No. 10 should be used. ‘For God’s sake, you’re still Prime Minister and speaking as such,’ said Alastair, ‘you’re not fleeing to no man’s land.’ As a compromise, it was decided to make the statement in Downing Street from a lectern. This was also to be the format of his subsequent statements on Monday and Tuesday.

But the press office could not find a suitably mobile lectern. ‘Are you sure you need one?’ asked Sue Nye. ‘Yes, this is too important to do from memory,’ said Gordon. After another hunt, a rickety old lectern was found, which had to be taped down outside No. 10 to keep it stable.

The statement, delivered at 1.40 p.m. against the background whirring of the TV helicopter, came over strongly and kept GB to the fore as Clegg and Cameron took their first steps together. Once delivered, exhaustion set in among the GB team. Some went home to get changed and get a bit of sleep; others fell asleep at their desks.

Gordon took calls on the euro crisis and the election results and considered his pitch to Clegg. And he waited for Cameron.

David Cameron’s statement at 2.30 p.m. was a thunderbolt. Far from proclaiming victory and demanding the keys to No. 10 immediately, he declared – three times – his intention to make ‘a big, open and comprehensive offer to the Liberal Democrats’. Directly pitching for a coalition, he described a minority Conservative government as ‘one option’ but emphasised the ‘common ground’ between the Tory and Lib Dem manifestos. ‘There is a case for going further than an arrangement which simply keeps a minority Conservative government in office,’ he said. ‘I want us to work together in tackling our country’s big and urgent problems … I think we have a strong basis for a strong government.’ Like Gordon, he mentioned electoral reform explicitly. He only promised a committee of inquiry to look at the issue but was quick to add: ‘Inevitably the negotiations we are about to start will involve compromise.’

Gordon’s first reaction was that Cameron had made a strategic error. ‘He’s underestimated his strength and legitimised the whole process of talks and negotiations,’ he said as he watched in the war room. Our hope was that this process would turn to our favour once the Tories and Lib Dems had rehearsed the extent of their differences. It also removed any lingering question of GB resigning immediately. The Queen’s Private Secretary, Christopher Geidt, was consistently clear throughout the five days that Gordon Brown should remain in office while credible talks between the parties were continuing, and there was no pressure from the other parties for him to do otherwise. The Queen herself spent the weekend at Windsor Castle as normal, although the significance of this was not noticed beyond royal circles at the time.

Cameron had made a strategic error if there was, indeed, no meeting of minds with Clegg. However, the post-statement moves between the Tories and the Lib Dems were swift and positive: an afternoon phone conversation between the leaders briefed as having gone well, and two hours of high-level talks between negotiators of the two parties in the Cabinet Office in the evening. Comprising William Hague, George Osborne and Oliver Letwin, the Tory team could not have been more heavyweight.

On our side, the initial moves were tentative and uncertain. Peter had a further phone conversation with Danny Alexander at 3.30. Danny reiterated Nick Clegg’s commitment to a ‘twin-track’ process, with Lab–Lib discussions to follow the initial Tory discussions. A call between Clegg and GB was fixed for 5 p.m. The big obstacles were also broached directly for the first time. ‘Nick views Gordon with great suspicion,’ Danny said bluntly. ‘A government headed by Gordon Brown, who has been defeated, would be difficult.’

The 5 p.m. Clegg–Brown call was the first contact between them since the election.

After congratulations from GB on Clegg’s campaign and results (‘rather like an uncle congratulating a nephew on good exam results’, one No. 10 aide recalled with a wince), they each sought to make one key point and kept coming back to it. Nick’s key point to Gordon was about process: talks with Labour would take place after those with the Tories, which had yet to become substantive, so there couldn’t be any immediate Lib–Lab negotiations. ‘I’ve only got this one negotiating team, and they can’t talk to both sides at the same time.’ Gordon’s point to Nick was about the common ground on policy between the parties and how he believed they could co-operate. ‘I’ve been reading your manifesto and I’ve written two papers on your policy positions and how we can work together. I can get them to you tonight if you like.’ Nick seemed surprised at this but said, ‘I’d really like to see your note.’ Gordon then went through the main policy areas – electoral reform, tax, the deficit, Europe – ‘I really think we can work together on all this.’ Clegg reiterated that he’d really like to see GB’s note.

As the conversation was ending, Gordon changed tack. ‘There are some things I need to say to you face to face, if we can meet tomorrow.’ Those listening to the call in the war room (GB was in his inner office) knew this was about his personal position and exchanged glances. Nick agreed but said he had a meeting with his MPs and his party executive during the day. ‘I’ll get back to you if that’s OK,’ he said about arrangements.

It had been civil and workmanlike. GB was the demandeur, doing the pushing. At a few points he talked over Clegg, ‘a bit like LBJ [the US President] on the tapes, holding the receiver close, exuding urgency, as GB always does on the phone’, as an aide put it. But there were no unpleasant, let alone angry, exchanges. Those listening in No. 10 thought it had been a constructive first move. The concern was to get the policy papers in shape to send to the Lib Dems that evening; they had only been written for internal consumption

Other phone calls on Friday evening were less constructive. Tony Blair had been speaking to his former inner circle, including some senior ministers and ex-ministers, calling it a ‘serious error’ for Gordon and Labour to be trying to stay in office. ‘The Tories may not have won the election but we lost it,’ was his line.

One of his inner circle was blunter still. ‘We are in danger of destroying the Labour Party for ever. This approach is madness,’ ran the text to me.

And unbeknown to Gordon Brown or his team, another critical conversation was being prepared for Saturday morning.

A key member of Clegg’s team was gearing up to tell the BBC that Nick’s phone call with Gordon Brown had gone extremely badly, in marked contrast to the pleasant and positive tone of the conversation with David Cameron.