The UK's path to reaching a divorce deal with the world's largest trade bloc has been far from the smooth ride promised by Brexiters during the EU referendum campaign. More than three years after the vote, UK Prime Minister Boris Johnson has agreed a withdrawal agreement with the EU. But how did the UK get to this point? The United Kingdom votes to leave the European Union in a referendum with 51.9 per cent in favour and 48.1 per cent against. David Cameron, the prime minister who had called the referendum and backed the remain side, resigns. He is replaced by Theresa May, who takes office on July 13. Ms May makes a surprise announcement that she wants to hold a snap election on June 8, claiming that “it is the only way to guarantee certainty for the years ahead”. One month before, the prime minister triggered Article 50 with parliamentary consent, thereby setting the date the UK leaves the EU as March 29, 2019. Her election-call gamble fails and the ruling Conservative Party lose their parliamentary majority. Ms May makes a confidence and supply agreement with the Democratic Unionist Party (DUP) meaning the small Northern Irish party will support the government in passing legislation through Parliament. Weakened by the election result, Ms May negotiates with Brussels to reach a withdrawal agreement. The EU says the deal must settle the UK’s financial obligations with the bloc, ensure EU citizens rights are protected and keep an open border on the island of Ireland. Mrs May says the UK must leave the EU’s customs union and the single market. The two sides had reportedly been about to agree a deal that Northern Ireland would effectively remain in the EU customs union and single market, while the rest of the UK would leave. However, Ms May is forced to leave a meeting with EU Commission President Jean-Claude Juncker to meet with the DUP, who say they cannot support such an arrangement. Ms May’s deal is rejected by Parliament in three “meaningful” votes taking place from January 2019. At issue is the controversial “backstop” element of the agreement, an insurance policy for keeping an open border between Northern Ireland and the Republic of Ireland – hated by the DUP and Brexiters from the Conservatives. The UK is granted two extensions to Article 50, the second of which delays the Brexit deadline to October 31. After the Conservatives perform dismally in European Parliament elections, Ms May steps down triggering a leadership contest. Former foreign secretary Boris Johnson wins promising to take the UK out of the EU with or without a deal by October 31. Fearful of crashing out without a deal, Parliament passes a bill to prevent such an outcome. The bill, which becomes known as the Benn Act, forces the government to seek an extension of Article 50 if a deal has not been agreed by Parliament by October 19. Mr Johnson ousts 21 MPs from the Conservatives for supporting the Benn Act. Brussels agrees a new withdrawal agreement with the Mr Johnson as European leaders convene at an EU summit. Within an hour of the announcement, the DUP says it cannot support the deal. Ruling with a majority of minus 45, Mr Johnson will need the support of opposition MPs if he is to get the deal passed by Parliament.