The "Inner Six" European countries signed the Treaty of Paris in 1951, establishing the European Coal and Steel Community (ECSC).

The 1955 Messina Conference deemed that the ECSC was a success, and resolved to extend the concept further, thereby leading to the 1957 Treaties of Rome establishing the European Economic Community (EEC) and the European Atomic Energy Community (Euratom).

In 1967, these became known as the European Communities (EC). The Merger Treaty, also known as the Treaty of Brussels, was a European treaty that unified the executive institutions of the European Coal and Steel Community (ECSC), Atomic Energy Community (Euratom) and the Economic Community (EEC). The treaty was signed in Brussels on 8 April 1965 and came into force on 1 July 1967. It set out that the Commission of the EEC and the Council of the EEC should replace the Commission and Council of Euratom and the High Authority and Council of the ECSC. Although each Community remained legally independent, they shared common institutions (prior to this treaty, they already shared a Parliamentary Assembly and Court of Justice) and were together known as the European Communities. This treaty is regarded by some as the real beginning of the modern European Union.

Some time after de Gaulle resigned in 1969, the UK successfully applied for EC membership, and the Conservative prime minister Edward Heath signed the Treaty of Accession in 1972.

Parliament passed the European Communities Act later that year and the UK joined Denmark and Ireland in becoming a member on 1 January 1973.

The opposition Labour Party won the February 1974 general election without a majority and then contested the subsequent October 1974 general election with a commitment to renegotiate Britain's terms of membership of the EC, believing them to be unfavorable, and then hold a referendum on whether to remain in the EC on the new terms.

Labour again won the election (this time with a small majority), and in 1975 the UK held its first ever national referendum, asking whether the UK should remain in the EC. Despite significant division within the ruling Labour Party, all major political parties and the mainstream press supported continuing membership of the EC.

On 5 June 1975, 67.2% of the electorate and all but two UK counties and regions voted to stay in; support for the UK to leave the EC in 1975 appears unrelated to the support for Leave in the 2016 referendum.

In the EC membership referendum of 1975, two-thirds of British voters favoured continued EC membership. Over the decades of UK-EU membership, Euroscepticism existed on both the left and right of British politics.

The Labour Party campaigned in the 1983 general election on a commitment to withdraw from the EC without a referendum.

After their heavy defeat in that election, Labour changed its policy. In 1985, the second Margaret Thatcher government ratified the Single European Act—the first major revision to the Treaty of Rome—without a referendum.

Thatcher, who had previously supported the common market and the Single European Act, in the Bruges speech of 1988 warned against "a European super-state exercising a new dominance from Brussels".

In October 1990, under pressure from senior ministers and despite Thatcher's deep reservations, the UK joined the European Exchange Rate Mechanism (ERM), with the pound sterling pegged to the deutschmark.

Thatcher resigned as Prime Minister the following month, amid Conservative Party divisions arising partly from her increasingly Eurosceptic views. The UK and Italy were forced to withdraw from the ERM in September 1992, after the pound sterling and the lira came under pressure from currency speculation ("Black Wednesday").

The UK Independence Party (UKIP), a Eurosceptic political party, was formed in 1993. It achieved third place in the UK during the 2004 European elections, second place in the 2009 European elections and first place in the 2014 European elections, with 27.5% of the total vote. This was the first time since the 1910 general election that any party other than Labour or the Conservatives had taken the largest share of the vote in a nationwide election.

Under the Maastricht Treaty, the EC became the EU on 1 November 1993, reflecting the evolution of the organisation from an economic union into a political one.

In 1994, Sir James Goldsmith formed the Referendum Party to contest the 1997 general election on a platform of providing a referendum on the nature of the UK's relationship with the rest of the EU.

In 2012, Prime Minister David Cameron initially rejected calls for a referendum on the UK's EU membership, but then suggested the possibility of a future referendum to endorse his proposed renegotiation of Britain's relationship with the rest of the EU.

On 23 January 2013, under pressure from many of his MPs and from the rise of UKIP, Cameron announced in his Bloomberg speech that a Conservative government would hold an in-or-out referendum on EU membership before the end of 2017, on a renegotiated package, if elected in the 7 May 2015 general election.

The Conservative Party won the election with a majority. Soon afterwards, the European Union Referendum Act 2015 was introduced into Parliament to enable the referendum. Cameron favored remaining in a reformed EU, and sought to renegotiate on four key points: protection of the single market for non-eurozone countries, reduction of "red tape", exempting Britain from "ever-closer union", and restricting immigration from the rest of the EU.

In the wake of the referendum of 23 June 2016, many new pieces of Brexit-related jargon entered popular use.

In a speech to the House of Commons on 22 February 2016, Cameron announced a referendum date of 23 June 2016, and commented on the renegotiation settlement. He spoke of an intention to trigger the Article 50 process immediately following a Leave vote and of the "two-year time period to negotiate the arrangements for exit."

The result was announced on the morning of 24 June: 51.89% voted in favor of leaving the EU (Leave), and 48.11% voted in favor of remaining a member of the EU (Remain). After the result was declared, Cameron announced that he would resign by October. He stood down on 13 July 2016, with Theresa May becoming Prime Minister after a leadership contest. A petition calling for a second referendum attracted more than four million signatures, but was rejected by the government on 9 July.

In January 2017, the UK Supreme Court ruled in the Miller case that government could only invoke Article 50 if authorized by an act of parliament to do so. The government subsequently introduced a bill for that purpose, and it was passed into law on 16 March as the European Union (Notification of Withdrawal) Act 2017.

The 2015 Referendum Act did not expressly require Article 50 to be invoked, but prior to the referendum, the UK government said it would respect the result. When Cameron resigned following the referendum, he said that it would be for the incoming prime minister to invoke Article 50. The new prime minister, Theresa May, said she would wait until 2017 to invoke the article, in order to prepare for the negotiations. In October 2016, she said UK would trigger Article 50 in March 2017, and in December she gained the support of MP's for her timetable.

In April 2017, Theresa May called a snap general election, held on 8 June, in an attempt to "strengthen [her] hand" in the negotiations; but the election resulted in a hung parliament, the Conservatives losing their majority. May remained as prime minister, as on 26 June she formed a minority government with a confidence and supply agreement with the Democratic Unionist Party.

Negotiations commenced on 19 June 2017.

In December 2017, a partial agreement was reached. It ensured that there would be no hard border in Ireland, protected the rights of UK citizens in EU and EU citizens in UK, and estimated the financial settlement to be £35–39 billion.

In March 2018, a 21-month transition period and the terms for it were provisionally agreed.

In June 2018, Irish Taoiseach Leo Varadkar said that there had been little progress on the Irish border question—on which the EU proposed a backstop, to come into effect if no overall trade deal had been reached by the end of the transition period—and that it was unlikely that there would be a solution before October, when the whole deal was to be agreed.

In July 2018, the UK government published the Chequers plan, its aims for the future relationship to be determined in the negotiations. The plan sought to keep UK access to the single market for goods, but not necessarily for services, while allowing for an independent trade policy. The plan caused cabinet resignations, including Brexit Secretary David Davis and Foreign Secretary Boris Johnson.

Prior to the negotiations, May said that the UK government would not seek permanent single market membership, would end ECJ jurisdiction, seek a new trade agreement, end free movement of people and maintain the Common Travel Area with Ireland. The EU had adopted its negotiating directives in May, and appointed Michael Barnier as Chief Negotiator. The EU wished to perform the negotiations in two phases: first the UK would agree to a financial commitment and to lifelong benefits for EU citizens in Britain, and then negotiations on a future relationship could begin. In the first phase, the member states would demand that the UK pay a "divorce bill", initially estimated as amounting to £52 billion. EU negotiators said that an agreement must be reached between UK and the EU by October 2018.

On 13 November 2018, UK and EU negotiators agreed the text of a draft withdrawal agreement, and May secured her cabinet's backing of the deal the following day, though Brexit Secretary Dominic Raab resigned over "fatal flaws" in the agreement. On 25 November, all 27 leaders of the remaining EU countries endorsed the agreement.

On 10 December 2018, the Prime Minister postponed the vote in the House of Commons on her Brexit deal. The announcement came minutes after the Prime Minister's Office confirmed the vote would be going ahead.

In December 2018, the European Court of Justice (ECJ) ruled that the UK could unilaterally revoke its notification of withdrawal, as long as it was still a member and had not agreed a withdrawal agreement. The decision to do so should be "unequivocal and unconditional" and "follow a democratic process".

On 15 January 2019, the House of Commons voted 432 to 202 against the deal, which was the largest majority against a United Kingdom government ever.

On 24 February, Prime Minister May announced that the next vote on the withdrawal agreement would be on 12 March 2019, 17 days away from Brexit.

On 18 March 2019, the Speaker (Speaker of the House of Commons) informed the House of Commons that a third meaningful vote could be held only on a motion that was significantly different from the previous one, citing parliamentary precedents going back to 1604.

On 20 March 2019, the Prime Minister wrote to European Council President Tusk requesting that Brexit be postponed until 30 June 2019.

On 21 March 2019, May presented her case to a European Council summit meeting in Brussels. After May left the meeting, a discussion amongst the remaining EU leaders resulted in the rejection of 30 June date and offered instead a choice of two new alternative Brexit dates.

On 22 March 2019, the extension options were agreed between the UK government and the European Council.

After the government deemed unwarranted the concerns over the legality of the proposed change (because it contained two possible exit dates) the previous day, on 27 March 2019 both the Lords (without a vote) and the Commons (by 441 to 105) approved the statutory instrument changing the exit date to 22 May 2019 if a withdrawal deal is approved, or 12 April 2019 if it is not. The amendment was then signed into law at 12:40 p.m. the next day.

The Withdrawal Agreement was brought back to the House without the attached understandings on 29 March.

On 10 April 2019, late-night talks in Brussels resulted in a further extension, to 31 October 2019; Theresa May had again requested an extension only until 30 June.

The first alternative offered was that if MPs rejected May's deal in the next week, Brexit would be due to occur by 12 April 2019, with, or without, a deal—or alternatively another extension be asked for and a commitment to participate in the 2019 European Parliament elections given.

Following the failure of the UK Parliament to approve the Withdrawal Agreement by 29 March, the UK was required to leave the EU on 12 April 2019.

The second alternative offered was that if MPs approved May's deal, Brexit would be due to occur on 22 May 2019.

Boris Johnson became prime minister on 24 July 2019 and met with EU leaders, the EU changed its stance.

The UK Parliament passed the European Union (Withdrawal) (No. 2) Act 2019, which received Royal Assent on 9 September 2019, obliging the Prime Minister to seek a third extension if no agreement has been reached at the next European Council meeting in October 2019.

In October, the UK parliament passed the Early Parliamentary General Election Act that bypassed the Fixed-term Parliament Act 2011 and called a general election for 12 December.

On 17 October 2019, following "tunnel talks" between UK and EU, a revised withdrawal agreement was agreed on negotiators level, and endorsed by the UK government and the EU Commission.

On 28 October 2019, the third extension was agreed to by the EU, with a new withdrawal deadline of 31 January 2020.

Subsequently, the government introduced a bill to ratify the withdrawal agreement. It passed its second reading in the House of Commons in a 358–234 vote on 20 December, and became law on 23 January as the European Union (Withdrawal Agreement) Act 2020.

The withdrawal agreement received the backing of the constitutional committee in the European Parliament on 23 January, setting expectation that the entire parliament would approved it in a later vote.

On the following day, Ursula von der Leyen and Charles Michel signed the withdrawal agreement in Brussels, and it was sent to London where Boris Johnson signed it.

The European Parliament gave its consent to ratification on 29 January by the votes 621 to 49. Immediately after voting approval, members of the European Parliament joined hands and sang Auld Lang Syne. The Council of the European Union concluded EU ratification the following day.

Exit day was 31 January 2020 at 11.00 p.m. GMT The European Union (Withdrawal) Act 2018 (as amended by a UK Statutory Instrument on 11 April 2019), in section 20 (1), defined 'exit day' as 11:00 p.m. on 31 October 2019. Originally, 'exit day' was defined as 11:00 p.m. on 29 March 2019 GMT (UTC+0).