The model Britain should be looking at, from this perspective, is not Norway’s or Switzerland’s or Canada’s trading relationship with the EU, but Canada itself: a medium-size economy flourishing next to a trading superpower; an open, multicultural democracy bound by trade agreements but not supranational institutions and law; and a country that has navigated the position in which it finds itself in the world—geographically in the New World but with ties to the old, spread out and linguistically divided, multicultural and multiethnic.

Read: This is just the beginning of Brexit

Canada has morphed from “senior dominion” in the British empire, in the words of the Canadian historian Margaret MacMillan, a professor at the University of Oxford, to a successful independent nation. Its steps along the way and the place it now occupies in the world offer lessons to its former mother country, which finds itself poorer per head, more at risk of disintegration, and less sure of how to balance its economic and geopolitical challenges than the place it once ran. Ultimately, the lessons from Ottawa offer both hope for London and warnings of the challenges ahead.

First, the challenges. Canada did not emerge as an independent nation through war or revolution; rather, it grew into a country over time, from disparate colonial possessions to a self-governing federation to, finally, a fully sovereign state in 1982. For much of its existence, Canada has been something of an adolescent, neither fully independent of its colonial power nor entirely dependent on it either. Its foreign policy was largely directed from London until well into the 20th century, but its existential concerns were distinct from those of Westminster.

This semi-independent status presented Canada with an overarching challenge: how to maintain good relations with the two principal powers that affected it, Britain and the United States. In MacMillan’s seminal work on the Paris Peace Conference, Peacemakers, she sets out how this goal was born out of self-interest. Ottawa, MacMillan writes, had “a recurring nightmare” following Britain’s 1902 Anglo-Japanese Alliance that it might find itself fighting as part of the British empire alongside its new ally, Japan, in a war against the United States. Simple geography meant that Canadian and British interests were not the same, and, in fact, were diverging. Even when Canadian and American interests came into conflict, Britain could not be relied on to defend Ottawa’s position—after all, London had good relations with Washington to consider.

This reality saw Canada begin to adopt its own positions, negotiating and signing its first international treaty independent of Britain in 1923 (a treaty regarding halibut fishing rights in the Pacific). The Canadian Encyclopedia, a national publication on Canadian history, describes this treaty as the moment that most clearly signaled the shift taking place in Canadian politics, “from one focussed on being a part of the British Empire, to one that was more pan-Canadian,” while also indicating Canada’s “shifting economic focus during the 1920s from Britain to the U.S.”