Boris Johnson can be a source of irritation to both Cameron and George Osborne, though for different reasons. To the latter, he is, according to one former Number 10 aide, just ‘plain annoying’. Cameron often finds Boris entertaining and funny. But when he gets under his skin, the gloves come off.

One Number 10 insider says: ‘There was a sense in this building that the PM and Chancellor were getting on taking the difficult decisions while Boris, with his crass bumbling, was lapping it all up and loving twisting the knife.’

After Johnson lists in print all the Old Etonians who have gone on to become prime minister, Cameron sends him a text: ‘The next PM will be Miliband if you don’t f****** shut up.’

After Boris Johnson (left) listed in print all the Old Etonians who have gone on to become prime minister, David Cameron sent him a text that read: ‘The next PM will be Miliband if you don’t f****** shut up’

'Boris is a fairweather friend who poses and can't be trusted'

According to one former Cameron aide, ‘there is a big feeling that Boris is a fair-weather friend who strikes poses and can’t be trusted.’ Relations plummet after Boris’s re-election as London mayor in 2012, with jealousy and resentment at his high profile and his effortless playing to the gallery. Cameron and Osborne, in contrast, are under great pressure.

The Conservatives do badly in the local elections. Johnson thinks seriously about taking on Cameron but knows that his re-election in London makes it impossible. Number 10 continue to watch Johnson carefully, and are never quite certain what he is up to.

On August 28, 2014, Cameron is enjoying himself with his team at Chequers, including political strategist Lynton Crosby, when they hear that Conservative MP Douglas Carswell has defected to UKIP and is to contest a by-election in Clacton.

Crosby texts Johnson to ask if he is interested in standing against him, but the reply comes back at once: ‘Thank you, no.’ Boris is only controllable up to a point.

In the wake of the 2013 murder in South East London of Fusilier Lee Rigby by two Islamic fundamentalists, Johnson attends a COBRA meeting. The atmosphere is very jumpy. It is agreed that no one should say anything beyond a bald holding line as the situation is still regarded as live and dangerous.

Johnson says that as mayor of London he must say something himself. One of the security staff intervenes to say: ‘Well, Mr Mayor, we don’t know the full facts yet and it’s quite dangerous and potentially lives are at risk if we start saying the wrong things.’

Cameron was angry with Osborne. He vowed that in future Number 10 'would have a much bigger footprint on the decisions in the run-up to the Budget'

‘I’ve got to go out there and say something,’ Johnson replies. He turns to one of the Number 10 aides and says: ‘Who the f*** is that guy? He needs to get elected before he tells me what to do!’ He then goes outside and makes a statement.

From 2013 Boris is more quiescent, partly because Osborne subtly lets it be known to him that if he wants Treasury support for his legacy as mayor, he must play by the rules.

There have been few relationships between Prime Minister and Chancellor as enduringly close as between Cameron and Osborne. But even here there can be tensions – and never more so than following the ‘omnishambles’ budget. ‘George felt incredibly cross with himself,’ reflects an insider who worked closely with Osborne on his 2012 Budget. ‘He had let people down. His reputation as the person who delivers the goods for the Government had, very rightly, taken a big knock.’

In the days leading up to the Budget, he revelled in the sangfroid of breezing off to Washington, joining Cameron on a visit to Obama. Yet a few days later, Osborne’s reputation was in tatters. What went wrong?

From the moment Labour raised the top income rate from 40p to 50p in 2009, Osborne was determined to bring it down.

His first Budget in 2011 failed to kick-start the economy, Britain was slipping into double dip recession and Osborne’s confidence had dipped seriously. He confides in friends he doesn’t know if he will ‘still be doing this job next year.’ He had ducked reducing the top rate in 2011 after objections from Cameron about how it would look.

But by January 2012, Osborne’s mind is settled. He speaks to Cameron about reducing it to 40p. Cameron thinks 40p is going too far, conscious of being portrayed as too favourable to the wealthy. But he removes his objection to 45p.

ABJECT LACK OF JUDGEMENT OVER COULSON On January 26, 2007, Andy Coulson resigns as editor of the News Of The World, denying all knowledge of phone hacking. Osborne identifies him as a candidate for the new role of director of communications. Cameron meets Coulson, asks about the hacking, and Coulson re-assures him. Cameron does not probe deeply. Coulson is duly appointed. Cameron will not abandon Coulson (right) The hacking concerns refuse to go away, however. Cabinet Secretary Gus O’Donnell worries that Cameron does not want to face up to the issue. Nor is O’Donnell happy with Coulson saying that he will quit if it becomes too big a distraction: this is an admission of guilt, he believes, and tells Cameron so. Cameron will not abandon Coulson. To do so, he says, would show weakness. But Coulson’s position is untenable. He quits on January 21, 2011. Cameron is mortified. On June 24, 2014, Coulson is jailed for 18 months. Was Cameron naive? It is possible, but there can be no doubt there was an abject lack of judgment. Advertisement

Cameron stopped Osborne backing the mansion tax

The Lib Dem Coalition partners are open to the idea of a cut to 40p on the key proviso that there is a mansion or property tax on the wealthy. It means a net tax rise on the rich, and Osborne is quite receptive.

However, Cameron’s shire Tory sensibilities are offended. He doesn’t like what he is hearing: this is rare territory, where his Toryism and Osborne’s are in an utterly different place. Cameron’s old friend Andrew Feldman doesn’t like it either. They put their foot down: a mansion tax is off the table.

The Lib Dems are granted a big increase in the personal allowance to compensate. But all this must be paid for which, as one insider admits, is ‘where the legs fell off the stool’.

A series of proposals for funding, produced by the Treasury, might make sense financially but they are politically unpalatable: the ‘pasty tax’ (VAT on hot takeaway food); the ‘caravan tax’ (a VAT rise on static caravans); and the ‘charity tax’ (lower relief on donations). It is all approved at one Coalition meeting because Osborne has to fly off to Washington with Cameron the next morning. Osborne thinks it is all sorted, but Number 10 are left frustrated: they feel frozen out of the Budget.

When the Lib Dems leak the tax cut, Number 10 is in a terrible state. It turns a potentially hazardous budget into a fiasco. The media go to town. The consequence is that March 21, a day that Osborne had been anticipating for months, if not years, turns into one of the unhappiest days of his life. Ed Miliband dismisses the ‘millionaire’s budget’.

‘The morning after the Budget, I could see we were in for months of misery,’ reflects Osborne. ‘I could see it starting to unravel.’

Cameron is angry with Osborne. He vows that in future Number 10 ‘will have a much bigger footprint on the decisions in the run-up to the Budget.’ But their relationship remains undamaged. ‘The Prime Minister never asked me to step down or even considered anything like that,’ Osborne says.

Osborne feared EU poll could damage him as a future PM

The proposed referendum on Britain’s membership of the EU is another rare fault line. Both men are profoundly irritated by their Eurosceptic MPs, but Osborne is even more pragmatic than Cameron.

The Chancellor’s view is that it is simply not sensible to talk about disengaging from major international institutions in the 21st Century – not even worth considering it. Osborne’s eye is on a further horizon than Cameron’s: his own leadership succession. Business opinion weighs heavily on him, and he is ‘loath to make the Conservative Party appear the riskier proposition to business than Labour.’

Cameron is more willing to engage the Euro-sceptics to see if can accommodate them.

But by spring 2012, the pressure for Cameron to commit to a referendum is virtually unstoppable. Having been initially reluctant, Osborne is won round. And on May 21 at the improbable location of a pizza restaurant at Chicago’s O’Hare airport it is settled.

Cameron sits down with William Hague and they agree to offer a referendum before the end of 2017. Osborne still has reservations. But Cameron can hold out no longer and the referendum is duly announced.

Osborne might often be the better tactician, but Cameron’s is always the more dominant voice. During Osborne’s dark months, and they were very dark, it is Cameron who sustains him. Osborne knows that.

Osborne (right) might often be the better tactician, but Cameron’s is always the more dominant voice

More serious even than the embarrassment of the 2012 Budget was the turmoil over Andrew Lansley’s NHS reforms. They are by far the biggest cock-up of Cameron’s premiership.

Cameron had promised no more ‘pointless re-organisations’ of the NHS – but Lansley’s shake-up was ‘so big you could see it from outer space’, in the words of one insider. There are two key elements: let local GPs make decisions hitherto taken by health authorities and switch day-to-day management of the NHS from Whitehall to a new post – the chief executive of ‘NHS England’.

The aim is to depoliticise the NHS.

Not until autumn 2013 does the Prime Minister realise he no longer has the levers to control the NHS. Only then does he admit that he fully ‘got’ the reforms.

PS: A WORD ABOUT WELLIES A farcical aspect of Cameron’s media sensitivity comes on a visit to the flooded Somerset Levels in 2014. Cameron worries his green Hunter boots make him look too posh. One of the staff is sent to Asda to buy cheap black wellies. That spring, Lynton Crosby learns one of the reasons voters give for saying Cameron is too posh – seeing him on television during the floods wearing a shiny new pair of black wellingtons... Cameron worries his green Hunter boots make him look too posh Advertisement

How on earth do two figures as savvy as Cameron and Osborne miss this? They simply don’t want to engage with reform of the NHS when they have so much else to think about, so they put it out of their mind.

The debate gets nasty. William Hague and Osborne raise objections: ‘We are doing what to the NHS? What the hell are we doing here? This is completely insane.’

Lansley goes off into an ‘impenetrable’ long spiel, speaking in specialist jargon. A furious Osborne says: ‘I didn’t understand a word. Nobody told me this was coming. Nobody.’

Craig Oliver and Andrew Cooper, the directors of communication and strategy respectively, tell Cameron the NHS reforms are a train crash waiting to happen. Cameron initially supports Lansley but agrees to a pause. Lansley is summoned to a meeting and starts arguing – ‘You can’t just stop everything’ – but Cameron slaps him down.

The NHS Bill is eventually passed but with many amendments. Number 10 are not happy and blame Lansley for making a ‘dog’s breakfast’ of it. The whole episode reveals Cameron at his most uncertain.

The Chancellor too has had his share of internal spats. In November 2014 the toxic issue of rising immigration is dominating the political agenda and sets Osborne at loggerheads with Home Secretary Theresa May. The Treasury traditionally favour free trade, seeing immigration as a net gain for the economy, far more so than a source of social or political anxiety. On the other side of the fence is May, who feels strongly about controlling immigration.

Each side is briefing against the other. Relations have become very fragile indeed. Exasperated, Cameron calls senior Cabinet Ministers to his No 10 office. Arguments ensue. One senior Number 10 aide has had enough: ‘What we all need to do is shut the f*** up talking about it,’ he cries.

Years of barely concealed impatience break out into the open. Osborne and his chief of staff Rupert Harrison have been sceptical of May’s line for a long time. They do not think the Home Office should be erecting barriers to good students coming to the UK.

They believe Cameron should have done much more to rein in May: a speech she gave in March 2013 on her ‘three pillars of Conservatism’ was widely regarded as her raising her leadership flag and provoked a vitriolic response from Osborne.

The Chancellor and Harrison react strongly against what they see as May’s increasing leadership pretensions which they regard as ‘ludicrous’. Cameron has had enough. He makes a speech praising how immigration has benefited Britain but promises more stringent controls. For the time being, the boil has been lanced.

Tears on the patio: 'It is clear we've lost and I will have to go'

At 3pm on May 7, 2015 – election day – speechwriter Clare Foges arrives at David Cameron’s house in Dean, Oxfordshire.

Cameron wants three separate speeches drafted.

Best case scenario is that the Conservatives have enough seats to form a coalition with the Lib Dems or the DUP.

At 3pm on May 7, 2015 – election day – speechwriter Clare Foges (pictured) arrives at David Cameron’s house in Dean, Oxfordshire. Cameron wants three separate speeches drafted

The second speech anticipates Labour being behind but trying to form a majority with the SNP.

The third speech is the bleakest. Cameron airs various thoughts which Foges takes down and crafts into a speech.

Later that afternoon, Cameron, wife Samantha, George Osborne, Ed Llewellyn and deputy chief of staff Kate Fall take a walk through the woods near Cameron’s house. They continue to discuss post-election outcomes. All the while, they are receiving mixed messages; some reports are optimistic, others pessimistic, talking of a high Labour turnout.

I hope they will say I did my duty. I wish Ed and Justine every success Cameron's speech if he lost the election

At one point, Cameron asks: ‘Are you sure we don’t need to have speech zero?’ This is in the event of the Conservatives winning an overall majority. The feeling is that, in the very unlikely event of that happening, it will be easy enough for him to construct what he needs to say. Afterwards they settle down on garden chairs for drinks on the patio. ‘I’m going to read you the speech,’ Cameron tells them. They go very quiet. They all know that this is effectively the ‘if we lose’ speech.

‘It is clear that we have not won and that I will have to go. I will be seeing the Queen later this morning,’ begins Cameron.

‘I hope they will say I did my duty. Being the prime minister of this country is the best job that one can possibly have. I wish Ed and Justine every success in doing it. Thank you for giving me the opportunity to serve.’

He talks about the state of the country when he walked into Number 10 five years ago, and he lists achievements, including creating two million jobs.

‘I will stay on as party leader until July but will not be making any comments or sharing any thoughts on my successor,’ he concludes.

As he talks, everyone is hugely emotional. Several aides have tears in their eyes. Cameron has convinced himself that he will not be prime minister in 24 hours.