Two new books on Brexit have unleashed a wave of heated exchanges between former prime minister David Cameron and Prime Minister Theresa May over their stance on tougher immigration controls.

May's camp released details of her private correspondence with Cameron to back her views on immigration control, condemning Cameron's "desperate" claims that she had asked him to take a softer line on limiting migration numbers from the EU.

The first book Unleashing Demons by Sir Craig Oliver, the communications director for Cameron, claims that the former premier was frustrated at May's refusal to help him make the cause for staying in the EU more forcefully, The Times reports.

The second book by the Sunday Times political editor Tim Shipman has "most angered" No 10, the newspaper said. In the book, Shipman claims that May, while she was the home secretary, had urged Cameron not to go against German Chancellor Angela Merkel by making a public demand for an emergency brake on EU immigration.

David Cameron and Theresa May
Theresa May reviews Cameron's policies after taking Downing Street. Reuters/Toby Melville

The brake would have given the UK government the right to impose immigration quotas in certain scenarios.

The book claims that May, together with the then foreign secretary Philip Hammond, had advised Cameron not to include the emergency brake request in his keynote speech that outlined his targets on re-negotiations in November 2014.

Following May and now Chancellor Hammond's advice, Cameron was claimed to have expressed regret and told one of his officials: "I can't do it without their support. We'll just have to go with the benefit plan. If it wasn't for my lily-livered cabinet colleagues ..." Shipman's book All Out War claims, according to The Spectator.

May's aides released details of two letters, dated 21 November 2014 and 21 May 2015, in which she had urged Cameron to secure an emergency brake during the talks with Brussels, The Times reports.

"Theresa May highlighted how important it would be secure real reform of free movement in the EU renegotiation, and that a more radical response was required, " the newspaper reported, quoting "a well-informed source."

On the meeting in Downing Street alluded to in the book, a close friend of May's insists that the meeting was pertaining to Cameron's keynote speech and not policy. "To suggest that it is evidence she took a soft line on immigration is just desperate."

Shipman's source however has counter-claimed the denial saying: "It's true she obviously wanted as good an immigration deal as she could get. It's true that she wrote a letter. But when the crunch moment came — do we take a risk, do we go for something that is going to be tougher and that Merkel is not going to back and that will be tougher to negotiation post the election? — her instinct was that if the Germans don't support it, we can't do it. That was her view and she said it in the meeting."

Columnist Fraser Nelson wrote in The Spectator: "Is Cameron seriously saying that Philip Hammond and Theresa May stopped him securing the emergency break that Merkel had anyway said she'd veto? As PM, he could ask for whatever he wanted — he had to get past 27 other veto-wielding EU nation states. A sceptical Home Secretary was the least of his worries."

Nelson said that had Cameron discharged his duty as prime minister and led the UK out of the EU and that if he had kept his word on not signing a deal with Brussels if it was not a good one, "then he would not be unemployed now. And that's on him — not Theresa May."