As the sun goes down on the UK’s last day as a member state of the European Union, the familiar flag of gold stars on a blue background will be lowered outside the British permanent representation and embassy on Avenue d’Auderghem in Brussels.

A few hours later on Friday, at the stroke of midnight Central European time, Britain’s membership of the EU will come to an end. “If the last few years are anything to go by, I will be in my office,” predicted Sir Tim Barrow, the UK’s 12th and last permanent representative in Brussels.

During 47 years of membership, Britain’s “perm reps” have been at the coalface of British diplomacy and negotiation in Europe. First under Ted Heath, whose life’s work was securing the UK’s entry into the then European economic community, and finally Boris Johnson, whose ambitions have been realised by its exit.

Speaking exclusively to the Guardian, the surviving nine permanent representatives – past and present – reflect on Britain’s European story, bearing witness to Margaret Thatcher’s “tears of rage”, John Major’s desperate threats of resignation, the folding to an ever-present Eurosceptic strain in British politics and the stagger to the exit.

The Ted Heath, Harold Wilson and Jim Callaghan years

For David Hannay, now Lord Hannay of Chiswick, a veteran of the 1970s accession talks who later served as Margaret Thatcher’s permanent representative in Brussels, Britain was set on its “turbulent” course when it failed to respond to decline by joining the original six in building the European economic community in 1957.

Facebook Twitter Pinterest Edward Heath signing the treaty for Britain to join the European economic community at the Palais d’Egmont in Brussels, Belgium, in 1972. Photograph: AP

“We spent 35 years dealing with the consequences: the budget rebate, the single market, the opt-out of the euro, the choice as to whether to opt-in on justice and home affairs,” said Hannay, 84. “The irony is that by about 2015 we had about got things right in terms of our national interest.”

In January 1973, Michael Palliser took his seat as the UK’s first permanent representative to the European economic community as a new breed of Europhile diplomat. His wife Marie was the daughter of the Belgian statesman and founding father of the European Union, Paul-Henri Spaak. Yet any perception of a British reconciliation with a European-facing future would be short-lived.

With Heath’s election defeat in 1974, a divided Labour government sought a renegotiation of terms ahead of an in/out referendum.

A private assurance by Palliser to European colleagues that modest change would be enough was leaked to the press by Luxembourg’s envoy, causing a scandal. When the referendum was nevertheless won by the yes campaign, his successor, Donald Maitland faced a new “difficult” foreign secretary, David Owen, who insisted on a “British Gaullist line being taken”, said Hannay. “By the time the Labour government had fallen in March 1979 people in Brussels were pretty sick of them.”

The Margaret Thatcher and John Major years

Labour’s tepid Europeanism made way in 1979 for a leader who certainly had a greater interest in Europe. Margaret Thatcher had one priority: reducing Britain’s budget contributions. For five years, with her “masterly” perm rep, Michael Butler, Thatcher “handbagged” fellow leaders into agreeing a rebate, Hannay recalls.

Facebook Twitter Pinterest Margaret Thatcher attending the summit of European leaders in Fontainebleau, France, in 1984. Photograph: AP

Thatcher’s settlement at the European council in Fontainebleau in the summer of 1984 was a barnstorming victory. But she recognised a need to banish the perception that Britain was just an awkward partner. That same year she gave the German chancellor, Helmut Kohl, a document entitled Europe: the Future, proposing a way forward to reducing barriers to trade in the single market and cooperate on foreign policy.

Thatcher was ambushed. “She had given it to the French and Germans, they barely gave it the time of the day and then tabled something almost identical,” Hannay recalls. The Franco-German axis was not ready for British leadership. Thatcher would never be as constructive again. “When I was about to go in 1985 as permanent representative, I suggested to her that Brussels is rather like a game of snakes and ladders,” Hannay said. “She said, ‘David you are quite wrong there – they are all snakes’.”

Britain’s envoy would later witness “tears of rage” at the antics of her fellow leaders. The outbursts against “weak men” are also sharp in the memory of John Kerr, now Lord Kerr of Kinlochard, who took over from Hannay in 1990. Kerr would develop a habit of seeking out the only other woman in the leaders’ summit room. “That was the head interpreter,” he said. “When she saw Thatcher storm off to the ladies she would go off too and they would have a chat. And she would tell me what it was about.”

Facebook Twitter Pinterest John Kerr, Britain’s permanent representative to the EU from 1990, witnessed Margaret Thatcher’s ‘tears of rage’. Photograph: AFP/Getty Images

Thatcher’s attitude to Europe hardened and “sowed the dragon’s teeth” that strongly sprouted in the late 2000s, Kerr and Hannay agree. The prime minister “thought it jolly clever” to enjoy the advantages of membership but bash Brussels, Hannay remembered. “I doubt many people now think it was all that clever.”

Thatcher’s downfall came with her rejection of monetary union in Rome in an impassioned, unscripted “No, no, no” in the House of Commons, an unnecessary position given Hannay had suggested an opt-out was possible.

Concerns over prime ministerial “recklessness” were further heightened by antagonism to German reunification, fostered in private by the French president, François Mitterrand, who pretended that they too wished to see the Germans “stamped upon all the time”, Hannay said.

But by November 1990 the Conservative party and the UK had a new leader – promising to be at the centre of Europe.

“John Major was seen in Brussels as young, energetic – and he wasn’t Margaret Thatcher,” said Kerr.

The Maastricht treaty is viewed today through the prism of Tory bloodletting. “But John Major negotiated very well at Maastricht,” Kerr recalled. “Helmut Kohl thought, ‘Oh he is a good guy, this fellow.’ People determined to screw us like the Belgians were told to shut up by the Germans.” An opt-out on currency union was secured with some diplomatic elan by Kerr: it was presented to leaders by the council’s head of legal services. But the Danish referendum rejecting the treaty caused a pause on ratification in the Commons and an opportunity for the sceptics to mobilise.

“It was in practice the triggering of an increasingly detached view of Europe which was not John Major’s own view,” said Stephen Wall, the UK’s perm rep between 1995 and 2000. “After the general election that he won in 1992 I remember saying to him, ‘Now you have your own mandate.’ He said, ‘Stephen, I am standing astride a crack in the Conservative party that is getting wider by the day.’ He would soon lose his majority.”

The UK’s suspension of its membership of the European exchange rate mechanism in September 1992 hit Major hard. He informed Wall that he had drafted a resignation letter. “I spent about three hours trying to persuade him not to implement it.”

The 1996 mad cow disease outbreak only amplified Major’s crisis in confidence. In response to an EU ban on British beef, the beleaguered prime minister blocked everything in Brussels – including the UK’s own proposals, and very nearly the UK’s own candidate as high representative to Bosnia.

Wall threatened to quit over rumours that the British government might act unlawfully by not paying its budget contributions. “By that stage our partners were beginning to think to themselves is this a country that is going to stay in the European Union?” Wall conceded. But a new dawn was supposedly breaking in the UK.

The Tony Blair and Gordon Brown years

Facebook Twitter Pinterest The German chancellor, Angela Merkel, speaking with the British prime minister, Gordon Brown, at the European council headquarters in Brussels in 2010. Photograph: Georges Gobet/AFP/Getty Images

Major’s defeat in 1997 was also a defeat for the sceptics. Blair pushed enlargement to the east against French scepticism. He sought to break Britain into the Franco-German engine room. But Blair did not break the mould. “The only foreign policy speech Blair made in the 1997 election, he said in terms that there is no difference in substance on [Labour and Conservative] policies including on the euro, ‘but the difference is that I am a leader and Major isn’t’,” Wall said.

An aide in Downing Street told Wall that a “Baghdad bounce” would allow the UK to join the euro. But it was a chimera. His chancellor, Gordon Brown, was manoeuvring on his Eurosceptic flank, regularly causing an atmosphere of crisis in meetings of EU finance ministers, said Nigel Sheinwald, who was perm rep between 2000 and 2003. The decision to invade Iraq split Britain from France and Germany, poisoning relations with Jacques Chirac and Gerhard Schröder. “And I don’t think any of us felt that we had won over public opinion,” said Sheinwald. “It was always unfinished business which our political leaders were never prepared to finish.”

When Brown moved into No 10, the UK’s transactional approach to the EU remained. The new prime minister did not want to attend the formal signing of the Lisbon treaty, negotiated by Blair. “Angela Merkel among others rang him up and said, ‘Gordon, you have got to go to this’,” recalled Kim Darroch, now Lord Darroch of Kew. Brown ended up in the worst of all worlds, pitching up late, “so his car was going one way from the airport as everyone else was going the other way”, said Darroch, who was perm rep from 2007 to 2011.

That did not mean that he, or Blair, were ineffective. Blair secured the European commission president that he wanted in José Manuel Barroso. John Grant, who succeeded Sheinwald, points to the decline in legislation under Barroso and since. Despite the UK not being in the single currency, Brown took a central role in Europe’s response to the financial crisis, and was notably invited to Paris by Nicolas Sarkozy to give his wisdom at a eurozone meeting. “I recall a commission official just before I left saying, ‘Before people used to say, when anything was proposed in Brussels, ‘What do the French and Germans think?’ And now people say what do the French, Germans and Brits think?’” Grant said. “But that didn’t last very long.”

The David Cameron and Theresa May years

Facebook Twitter Pinterest David Cameron attending a European council meeting in Brussels in 2016. Photograph: Dan Kitwood/Getty Images

Angela Merkel, the German chancellor, had reassured David Cameron that the EU would enjoy a period of “calm on his watch”, recalled Ivan Rogers, the UK perm rep from 2013 to 2017. Then the eurozone crisis hit. In 2011, there was a need to make surgical treaty changes at great speed in order to build institutions to save the eurozone. Cameron saw a risk of backbench revolt if he took it through the Commons and tried to turn it into an opportunity to carve out further protections for the City of London.

It was a disaster. In his campaign for the leadership of the Conservatives, Cameron had promised to take them out of the Europhile European People’s party in the European parliament. He had done so. And at an EPP dinner in Marseille the night before a December Brussels summit, Merkel and Sarkozy plotted to go around any British veto by agreeing to make a pact outside the EU treaties. Britain looked powerless.

“It had a lot of theatre in it,” said Jon Cunliffe, perm rep from 2012 to 2013, and now deputy governor of the Bank of England. “It maybe crystallised for many people that this relationship was getting difficult.” Back home, Cameron enjoyed a bounce in the polls for wielding the veto. “But I think Frau Merkel said to him at one stage, ‘All the wrong people are cheering you, David’,” Rogers said.

Facebook Twitter Pinterest Ivan Rogers, the UK permanent representative to the EU from 2013 to 2017, when the eurozone crisis hit. Photograph: Dominic Lipinski/PA

The subsequent 2015 Conservative manifesto promised an in/out referendum, with a renegotiation ahead of it. But swift treaty change was impossible. A temporary fix on free movement was needed. Blair had not enforced any transition controls on migration from Poland and elsewhere in 2004, unlike Germany and others. But when Cameron suggested to Merkel that “a trigger which enables me over a limited period of time to cap numbers” could be a silver bullet, a “steamed-up” German chancellor was having none of it, recalled Rogers. “No, no, no way – never David,” she told the prime minister.

Cunliffe believes the EU did not “get it”. “I think the EU was quite late to say, ‘Look, we want to keep free movement but we need to give politicians of the centre the ammunition so they can say I can deal with the problems that free movement might create and that will take one of the tensions away’,” he said. “They weren’t prepared to do that. They actually weren’t prepared to do that during the Cameron negotiation.” The referendum result was as Rogers had warned.

Timeline From Brefusal to Brexit: a history of Britain in the EU Show Hide After 47 years and 30 days it was all over. As the clock struck 11pm on 31 January 2020, the UK was officially divorced from the EU and began trying to carve out a new global role as a sovereign nation. It was a union that got off to a tricky start and continued to be marked by the UK’s sometimes conflicted relationship with its neighbours. Brefusal The French president, Charles de Gaulle, vetoes Britain’s entry to EEC, accusing the UK of a “deep-seated hostility” towards the European project. Brentry With Sir Edward Heath having signed the accession treaty the previous year, the UK enters the EEC in an official ceremony complete with a torch-lit rally, dickie-bowed officials and a procession of political leaders, including former prime ministers Harold Macmillan and Alec Douglas-Home.

Referendum The UK decides to stay in the common market after 67% voted "yes". Margaret Thatcher, later to be leader of the Conservative party, campaigned to remain. 'Give us our money back' Margaret Thatcher negotiated what became known as the UK rebate with other EU members after the "iron lady" marched into the former French royal palace at Fontainebleau to demand “our own money back” claiming for every £2 contributed we get only £1 back” despite being one of the “three poorer” members of the community. It was a move that sowed the seeds of Tory Euroscepticism that was to later cause the Brexit schism in the party. The Bruges speech Thatcher served notice on the EU community in a defining moment in EU politics in which she questioned the expansionist plans of Jacques Delors, who had remarked that 80% of all decisions on economic and social policy would be made by the European Community within 10 years with a European government in “embryo”. That was a bridge too far for Thatcher. The cold war ends Collapse of Berlin wall and fall of communism in eastern Europe, which would later lead to expansion of EU. 'No, no, no' Divisions between the UK and the EU deepened with Thatcher telling the Commons in an infamous speech it was ‘no, no, no’ to what she saw as Delors’ continued power grab. Rupert Murdoch’s Sun newspaper ratchets up its opposition to Europe with a two-fingered “Up yours Delors” front page. Black Wednesday A collapse in the pound forced prime minister John Major and the then chancellor Norman Lamont to pull the UK out of the Exchange Rate Mechanism. The single market On 1 January, customs checks and duties were removed across the bloc. Thatcher hailed the vision of “a single market without barriers – visible or invisible – giving you direct and unhindered access to the purchasing power of over 300 million of the world’s wealthiest and most prosperous people". Maastricht treaty Tory rebels vote against the treaty that paved the way for the creation of the European Union. John Major won the vote the following day in a pyrrhic victory. Repairing the relationship Tony Blair patches up the relationship. Signs up to social charter and workers' rights. Ukip Nigel Farage elected an MEP and immediately goes on the offensive in Brussels. “Our interests are best served by not being a member of this club,” he said in his maiden speech. “The level playing field is about as level as the decks of the Titanic after it hit an iceberg.” The euro Chancellor Gordon Brown decides the UK will not join the euro. EU enlarges to to include eight countries of the former eastern bloc including Poland, Hungary and the Czech Republic. EU expands again, allowing Romania and Bulgaria into the club. Migrant crisis Anti-immigration hysteria seems to take hold with references to “cockroches” by Katie Hopkins in the Sun and tabloid headlines such as “How many more can we take?” and “Calais crisis: send in the dogs”. David Cameron returns from Brussels with an EU reform package - but it isn't enough to appease the Eurosceptic wing of his own party Brexit referendum The UK votes to leave the European Union, triggering David Cameron's resignation and paving the way for Theresa May to become prime minister Britain leaves the EU After years of parliamentary impasse during Theresa May's attempt to get a deal agreed, the UK leaves the EU.

Theresa May’s subsequent arrival at Downing Street came with a distinct style. Attendance of meetings on what was to be done were kept strictly to officials and her chiefs of staff, Nick Timothy and Fiona Hill. The circle, however, got tighter. In the new prime minister’s first conference speech in 2016 she told the party faithful the UK would be out of the single market, customs union and the jurisdiction of the European court of justice.

It came out of nowhere. “I have never known a circumstance in which key people like the cabinet secretary and like me didn’t even see the speech before it was delivered,” Rogers said. The European commission president, Jean-Claude Juncker, approached Britain’s envoy. “I have read her speech three times very, very carefully,” he told him. “And I can only conclude that you are going outside the EU orbit much further than I would have expected you to … She didn’t need to go that far.”

Play Video 5:36 The road to Brexit: the lols and the lows - video supercut

Rogers warned the prime minister that her speech had, in the eyes of Brussels, reduced the options to a basic free-trade deal, which would require a lengthy transition period before perhaps coming into force in the “early to mid 2020s”. The minute was leaked to the BBC and Rogers subsequently resigned his position, making way for Sir Tim Barrow in 2017, and three troubled years of negotiations.

As of 1 February, Barrow’s title will change to UK ambassador to the EU, “to be the link between Brussels and London as we negotiate our future partnership,” Barrow said. It remains to be seen whether London will listen.