On June 16, 1940, with Nazi Germany on the brink of crushing France, British prime minister Winston Churchill and French undersecretary of defense Charles de Gaulle met for lunch at the Carlton Club in London. These two great symbols of patriotism and national independence made an incredible agreement: Britain and France should be united into a single country called the “Franco-British Union.”

This was just two weeks after British and French troops were rescued from the beaches of Dunkirk, where they had become surrounded by German troops—a story captured in the new Christopher Nolan film Dunkirk. Although that battle story is fairly well known, the accompanying political drama that almost saw Britain and France merge is now largely forgotten. But the drama of that near-fusion can help explain the origins of European integration—and the reasons why Britain ultimately pulled away from the European Union in the decision we know as Brexit.

The scheme was born of crisis. On May 10, 1940, Germany had begun a relentless Blitzkrieg assault on France, and within a month, French resistance had largely collapsed. Defeatism was rife in France, and a dramatic step was needed to encourage the country to keep fighting from its colonies, and to stop the French fleet from falling into German hands.

The plan that emerged—to unify Britain and France into a single state—was not entirely new: The idea of integrating the European countries had floated around political circles for a few years, but always seemed fantastical. Catastrophe was about to turn impossibility into official policy.

On June 14, German troops entered Paris. During the next 48 hours, British and French civil servants drafted a proposal for a “Declaration on Franco-British Union.” This was no beefed-up wartime alliance, or a plan for partial integration similar to today’s European Union. The goal was to effectively create one country. The document stated: “At this most fateful moment in the history of the modern world, the Governments of the United Kingdom and the French Republic make this declaration of indissoluble union and unyielding resolution in their common defense of justice and freedom against subjection to a system which reduces mankind to a life of robots and slaves.” This meant: “France and Great Britain shall no longer be two nations, but one Franco-British Union.”

At a stroke, hundreds of years of constitutional history would be swept away. There would be joint control of defense, foreign policy, finance, and economic policy. The two parliaments would be united, presumably with French representatives sitting in the House of Commons in London. Churchill’s private secretary said, “We had before us the bridge to a new world, the first elements of European or even World Federation.”

Events moved fast. On June 16, Churchill was personally skeptical but presented the idea to the all-party British Cabinet. He was swept along by a wave of enthusiasm. “I was somewhat surprised,” wrote Churchill, “to see the staid, solid, experienced politicians of all parties engage themselves so passionately in an immense design whose implications and consequences were not in any way thought out.” Churchill put his doubts aside and told the Cabinet, “In this crisis we must not let ourselves be accused of lack of imagination.”

Charles de Gaulle, who had arrived that morning in London, also had qualms about ending the country of France as he knew it. But de Gaulle embraced the plan as a grand move to change the course of history: “The gesture must be immediate.”

At 4:30 pm, de Gaulle telephoned Paul Reynaud, the French prime minister, who had fled the advancing Germans, going from Paris to Tours and then Bordeaux. Reynaud listened to the proposal for a Franco-British Union with mounting excitement, as he scribbled down the details. Here lay possible salvation for France. According to one eyewitness, “His eyebrows went up so far they became indistinguishable from his neatly brushed hair.” Reynaud suddenly interrupted de Gaulle. “Does he agree to this? Did Churchill give you this personally?” De Gaulle handed the receiver to Churchill, who assured Reynaud that he approved. Reynaud was “transfigured with joy.”

In London, Churchill boarded a train along with leaders of the major parties, ready for a rendezvous with destiny. The train would travel to the coast, and then the party would sail by ship to meet the French government and sign the Act of Union.

The train never left the station. The scheme collapsed as quickly as it arose. In the days prior to June 16, the French government had become consumed by defeatism, as well as anger at Britain for the perceived abandonment at Dunkirk (over 100,000 French troops had been rescued but thousands more were left behind on the beach, where they were forced to surrender to the Germans). Reynaud presented the proposal to the French Council of Ministers, but it was rejected as a British plot to seize the French empire. Marshal Pétain, 84 years old and the great hero of World War I, believed it was his duty to save France from total destruction and accept an armistice with Germany. Britain was doomed, he said, and union would be “fusion with a corpse.” Another minister concluded: “Better be a Nazi province. At least we know what that means.” Reynaud later wrote in his memoirs, “Those who rose in indignation at the idea of union with our ally were the same individuals who were getting ready to bow and scrape to Hitler.”

After hearing news of the French decision, Churchill left the train “with a heavy heart.” He drove to Downing Street and got back to work. Within days, Pétain took over the French government and pursued an armistice with Germany. Britain was alone.

The Franco-British Union is an extraordinary near-miss of history. Defeatism struck the French government late but decisively. If Reynaud had proposed the idea a week, or even a few days, earlier, it might well have been accepted. And we can only guess at the consequences. The French might have kept fighting from their empire, with no Vichy regime. Britain and France might have extended the offer of union to other exiled governments like Poland, Czechoslovakia, Belgium, or Holland—and created a United States of Europe. The war could have ended with three great powers: the USA, the Soviet Union, and the USE.

In the collapse of the Franco-British Union, we can discover the seeds of the European integration project. One of the civil servants who crafted the plan in 1940 was Jean Monnet, who would later become an architect of integration and be known as the “father of Europe.” Monnet said, “Ideas do not die and if nations can come so close together in war, perhaps we can carry some fraction of that accord into the peace.” The lesson that struck Monnet and other federalists with such force in 1940 would become even stronger after 1945. Only European integration could overcome the catastrophe of nationalism and militarism, which delivered two world wars in a generation. And the story of the Franco-British Union also reveals another powerful reason for integration: threat. In 1940, the German menace convinced ardent nationalists like Churchill and de Gaulle to back the union idea. After 1945, the Soviet peril was a driving force behind the European project.

But events in 1940 also help explain why Britain was always ambivalent about joining the European project. During World War II, the Franco-British Union was quickly forgotten, and a new narrative emerged of heroic resistance. Surviving Dunkirk, winning the Battle of Britain, and enduring the Blitz created the narrative of an island nation fighting alone for freedom. Rather than look for union with a devastated continent, Britain’s destiny lay West, in a special relationship with the United States. Churchill told the French, “Whatever you may do, we shall fight on forever and ever and ever.”

In 2016, as the British voted for Brexit, it was the spirit of Dunkirk that prevailed, not the torch of the Franco-British Union. The champions of Brexit claimed to be defending Churchill’s legacy—even though Churchill had backed union with France. One Conservative Party minister wrote: “The spirit of Dunkirk will see us thrive outside the EU.” The crisis of 1940 opened up the possibility for a bold plan to unite Europe against tyranny. But the evacuation at Dunkirk was soon recalled in Britain as a very literal attempt to escape the continent.