David Cameron’s defeat at the EU referendum has led to him being ranked as the third worst Prime Minister of any to have held the office since the end of the Second World War, according to experts.

The research, which ranks Clement Attlee, the first post-war Prime Minister, in first place suggests history will view Mr Cameron unfavourably. Around 90 per cent of the academics cited the referendum as Mr Cameron’s greatest failure, with one concluding the defeat was the greatest failure of any Prime Minister “since Lord North lost America” and was forced to resign from the post in 1782.

When the academics involved in the study, led by the University of Leeds, were asked to rate the 13 post-war Prime Ministers, Mr Cameron fared particularly badly in “foreign policy and Britain’s role in the world” with -67 net score. In the overall ratings he ranked above Alec Douglas-Home, the Conservative prime minister between 1963 and 1964 and Anthony Eden, another Conservative leader from 1955 to 1957. Mr Eden’s premiership ended after his reputation lay in tatters after his controversial handling of the Suez crisis.

The survey of 82 academics, specialising in post-1945 British history and politics, was carried out at the University of Leeds in collaboration with Woodnewton Associates, a market research company.

Respondents were asked to rate the performance of each leader during their tenure in Downing Street on a scale of 0-10, with 10 representing the top score of “highly successful”.

The last time the research was carried out, in 2010, Gordon Brown, who was in office during the financial crash of 2008, was rated as the third worst prime minister in modern history. But Mr Cameron’s gamble with Britain’s membership of the EU has moved Mr Brown to the fourth worst prime minister in the rankings.

Professor Kevin Theakston, at the University of Leeds, said: “For all his achievements as a successful coalition Prime Minister, David Cameron’s reputation and place in history seems destined to be defined by Brexit and his calling and losing the referendum.”

“Academic opinion, as reflected in our survey, is currently pretty damning. But reputations can wax and wane as subsequent events, the passage of time and new evidence change perspectives. Depending on how Brexit works out, future historians and political scientists may come to a different view of Mr Cameron’s premiership and his place in the league table of Prime Ministers,” he added.

The post-war league table of Prime Ministers

1. Clement Attlee, Labour 1945-51

2. Margaret Thatcher, Conservative 1979-90

3. Tony Blair, Labour 1997-2007

4. Harold Macmillan, Conservative 1957-63

5. Harold Wilson, Labour 1964-70 and 74-76

6. John Major, Conservative 1990-97

7. Winston Churchill, Conservative 1951-55

8. James Callaghan, Labour 1976-79

9. Edward Heath, Conservative 1970-74

10. Gordon Brown, Labour 2007-10

11. David Cameron, Conservative 2010-16

12. Alec Douglas-Home, Conservative 1963-64