The visa waiver deal had been due to kick in on July 1, and there were fears that Erdogan would increase migrant flows if he did not get his way.

However, Sir Sebastian says that Berlin thinks it can “keep Erdogan at the table” and can keep “the deal in play through the summer spike” with a “carefully fudged delay on both sides until October”.

In the memo from May 13, the ambassador said Erdogan’s pursuit of Jan Boehmermann, a German satirist, has “only strengthened the view that he is an authoritarian bully who is trying to blackmail Europe.”

Uwe Corsepius, Mrs Merkel’s Europe adviser, told Sir Sebastian that Erdogan was ready to delay, meaning they could avoid a “major escalation of tensions” before Britain’s referendum on June 23.

However, a second DipTel, from Richard Moore, the British ambassador to Turkey, is more pessimistic.

It warns: “If visa liberalisation doesn’t happen, an impetuous and riled Erdogan – prone to come out fighting when he feels ‘betrayed’ – could carry through his threat to ‘open the flood gates’ to Europe for migrants.”

It floats the idea that Britain could extend the travel rights for around one million Turkish citizens who hold special passports, saying there will be “questions and complaints” about the difficulty of reaching the UK, which is outside the Schengen zone.