David Cameron and Barack Obama, pictured together at the G7 summit where they clashed over defence spending

Barack Obama blasted David Cameron for 'free riding' over defence and has privately accused the British Prime Minister of leaving Libya a 's*** show', it emerged today.

In a remarkable insight into the US President's critical view of Mr Cameron's foreign policy, it was revealed today that Mr Obama believed Britain and France were too happy to rely on the US to deal with conflicts on Europe's doorstep.

And he warned Mr Cameron last summer that the 'special relationship' between Britain and America would be lost if he refused to commit the UK to spending the Nato target of 2 per cent of GDP on defence.

In an in-depth interview with The Atlantic magazine, Mr Obama said he wanted Mr Cameron and the then French President Nicolas Sarkozy to take charge of the campaign to oust Libyan dictator Colonel Gadaffi in the spring of 2011 instead of relying on the US acting 'unilaterally'.

He wanted the two countries to break their habit of 'pushing us to act but then showing an unwillingness to put any skin in the game'.

He even went as far as describing the likes of Britain and France as 'free riders,' adding later that he had told Mr Cameron that 'free riders aggravate me' when he had told the PM: 'You have to pay your fair share'.

In a damning assessment of Mr Cameron's record in Libya, Mr Obama said bluntly that the intervention 'didn't work' and had left the country a 's*** show'.

In a wide-ranging interview it was revealed:

Mr Obama warned Mr Cameron the 'special relationship would be destroyed if Britain did not meet the Nato target of spending at least 2 per cent of GDP on defence

He told the PM that 'free riders aggravate me' as he told him to 'pay your fair share'

Mr Obama cited Britain as a 'major factor' in his decision no to enforce the 'red line' on the use of chemical weapons by the Syrian regime

The President said Mr Cameron became 'distracted' after Britain's initial intervention in Libya in the spring of 2011

The US policy of leaving Libya to the UK and France 'didn't work'

Mr Obama thought the situation in Libya 'broke down very quickly' and the British and French left the country a 's*** show'

Mr Obama said he had more faith in the Europeans but admitted it had been a mistake to trust Mr Cameron and Mr Sarkozy.

'When I go back and I ask myself what went wrong, there's room for criticism, because I had more faith in the Europeans, given Libya's proximity, being invested in the follow-up,' Mr Obama said.

He revealed his irritation as he said Mr Cameron became 'distracted by a range of other things' in the aftermath of the Libya campaign, while the French president was ousted a year.

Mr Cameron and Mr Obama, pictured together in the Oval Office, have enjoyed a mostly close relationship over the past several years with a series of bilateral meetings

Explaining why he wanted Europe to play the lead in Libya, Mr Obama said: 'Sometimes we're going to get what we want precisely because we are sharing in the agenda.

'The irony is that it was precisely in order to prevent the Europeans and the Arab states from holding our coats while we did all the fighting that we, by design, insisted.'

He added: 'It was part of the anti–free rider campaign.'

In the interview, Mr Obama also cited Britain as a 'major factor' in his decision not to enforce the 'red line' on the use of chemical weapons by the Syrian regime.

The President called off at the last minute a planned attack in response to the gassing as he decided to refer the issue to a vote in Congress.

Mr Obama said: 'We had UN inspectors on the ground who were completing their work, and we could not risk taking a shot while they were there.

'A second major factor was the failure of Cameron to obtain the consent of his parliament.'

The US President also revealed he addressed defence spending with the Prime Minister at last June's G7 summit.

Just weeks later, Chancellor George Osborne delivered his summer Budget which included increased defence spending.

Mr Cameron had been criticised by his own backbenchers over the threat Britain would fall behind the Nato target of spending 2 per cent of GDP on defence.

But in a stark warning from the US President, he said 'free riders aggravate me' in the talks with Mr Cameron, and told him: 'You have to pay your fair share.'

Speaking shortly after Mr Osborne's announcement, Mr Cameron said: 'It's about making sure we are safe in a very dangerous and unstable world.

'Because we've got a strong economy we can now make the commitment to spending more - over and above inflation - on defence, as much potentially as £6billion more between now and 2020, and that will make sure Britain is safer.'

Highlighting the threat from Islamic extremism on a visit to an RAF base, he said: 'And I'm absolutely determined that the RAF, Army and Navy will have the equipment, the means and the resources to deal with it.

'One of the things that we need is making sure that we have the drones, spy planes and special forces - the unique capabilities that make sure we can deal with this threat at its source.'

Obama warned Cameron that the 'special relationship' between UK and America would be destroyed if UK defence spending did not meet the Nato target

Barack Obama warned David Cameron that the 'special relationship' between Britain and America would be lost if UK defence spending did not meet the Nato target.

The US President revealed he addressed defence spending with the Prime Minister at last June's G7 summit.

Just weeks later, Chancellor George Osborne delivered his summer Budget which included increased defence spending.

Barack Obama (right) warned David Cameron (left) that the 'special relationship' between Britain and America would be lost if UK defence spending did not meet the Nato target

Mr Cameron had been criticised by his own backbenchers over the threat Britain would fall behind the Nato target of spending 2 per cent of GDP on defence.

But the stark warning from Washington was revealed by Mr Obama in an interview with The Atlantic magazine.

He said 'free riders aggravate me' in the talks with Mr Cameron, and told him: 'You have to pay your fair share.'

Speaking last summer, shortly after Mr Osborne's announcement, Mr Cameron said: 'It's about making sure we are safe in a very dangerous and unstable world.

'Because we've got a strong economy we can now make the commitment to spending more - over and above inflation - on defence, as much potentially as £6billion more between now and 2020, and that will make sure Britain is safer.'

Highlighting the threat from Islamic extremism on a visit to an RAF base, he said: 'And I'm absolutely determined that the RAF, Army and Navy will have the equipment, the means and the resources to deal with it.

'One of the things that we need is making sure that we have the drones, spy planes and special forces - the unique capabilities that make sure we can deal with this threat at its source.'

Britain played a 'major factor' in Obama's decision not to bomb Syria in 2013 after Assad's 'red line' use of chemical weapons

The decision by British MPs to narrowly reject air strikes against President Assad's Syrian regime in the summer of 2013 was a 'major factor' in Barack Obama's decision not to authorise bombing himself.

Barack Obama had said in 2012 that the use of chemical weapons by President Assad (pictured) would be a 'red line' and would 'change my calculus' on the conflict, suggesting it would lead to US air strikes in Syria

The US President said a year earlier that the use of chemical weapons by the Assad regime would be a 'red line' and would 'change my calculus' on the conflict, suggesting it would lead to US air strikes in Syria.

But after Labour leader Ed Miliband decided to order his MPs to oppose military action in Syria, MPs in the House of Commons defeated the Government and David Cameron was forced to rule out British air strikes in August 2013.

In an interview with The Atlantic magazine Mr Obama said this played a big role in his decision to call off a planned attack by the US in response to the gassing.

Instead he decided to refer the issue to a vote in Congress.

Explaining the situation at the time, Mr Obama said: 'We had UN inspectors on the ground who were completing their work, and we could not risk taking a shot while they were there.

'A second major factor was the failure of Cameron to obtain the consent of his parliament.'

But the most important factor in the decision to call off American air strikes at the time was the lack of a guarantee that bombing would eliminate President Assad's use of chemical weapons themselves.

The US President said: 'Our assessment that while we could inflict some damage on Assad, we could not, through a missile strike, eliminate the chemical weapons themselves, and what I would then face was the prospect of Assad having survived the strike and claiming he had successfully defied the United States, that the United States had acted unlawfully in the absence of a UN mandate, and that that would have potentially strengthened his hand rather than weakened it.'

This was despite saying a year earlier, in August 2012, that the use of chemical weapons was a 'red line'.

Speaking in 2012, Mr Obama had said: 'We have been very clear to the Assad regime … that a red line for us is we start seeing a whole bunch of chemical weapons moving around or being utilized.

'That would change my calculus. That would change my equation.'

Libya is a 's*** show' which is run by ISIS after Britain and France lost interest after the bombing campaign, Barack Obama claims

Libya has been left a 'shit show' that is a haven for ISIS terrorists because Britain and France failed to follow through on the bombing campaign against Colonel Gadaffi, Barack Obama has claimed.

The US President pushed Europe to take the lead in the Libyan campaign in 2011 as he sought to reduce the West's reliance on American might to police the Middle East and North Africa.

But in a major interview with The Atlantic magazine, Mr Obama acknowledged he had too much faith in Britain and France being invested in the 'follow up' to the conflict.

He accused Prime Minister David Cameron of become 'distracted by other things' and added then French president Nicolas Sarkozy was kicked out by the electorate a year after the campaign.

David Cameron, right, and Nicolas Sarkozy, left, made a triumphant visit to Benghazi in the immediate aftermath of the bombing to meet Mustafa Abdul Jalil, centre, but Barack Obama said they lost interest

The President said he was keen from the outset to have the operation led by European nations but is reported to admit privately the situation is now a 's*** show'.

He said: 'The way I looked at it was that it would be our problem if, in fact, complete chaos and civil war broke out in Libya.

'At that point, you've got Europe and a number of Gulf countries who despise Qaddafi, or are concerned on a humanitarian basis, who are calling for action.

'But what has been a habit over the last several decades in these circumstances is people pushing us to act but then showing an unwillingness to put any skin in the game.'

Mr Obama said he was concerned about 'free riders' calling on American power for their own security.

He added: 'So what I said at that point was, we should act as part of an international coalition.

'But because this is not at the core of our interests, we need to get a UN mandate; we need Europeans and Gulf countries to be actively involved in the coalition; we will apply the military capabilities that are unique to us, but we expect others to carry their weight.

'And we worked with our defense teams to ensure that we could execute a strategy without putting boots on the ground and without a long-term military commitment in Libya.

'So we actually executed this plan as well as I could have expected: We got a UN mandate, we built a coalition, it cost us $1 billion—which, when it comes to military operations, is very cheap.

'We averted large-scale civilian casualties, we prevented what almost surely would have been a prolonged and bloody civil conflict.