E UROPE’S POST-COLD-WAR history can be conveniently divided into three decade-long phases. The first, from the fall of the Berlin Wall in 1989 to the introduction of the euro in 1999, was marked by institutional expansion. The period from 1999 to 2009 was one of geographical expansion as the union took in 12 new members. But since 2009 crisis has dominated: in the euro zone, in the EU ’s near-abroad from Ukraine to Syria, in trans-Mediterranean migration flows, in Britain’s decision to leave and in the transatlantic alliance under President Donald Trump. Once benign-seeming actors like China and Silicon Valley technology firms have turned threatening. Europe has seemed like a dry leaf tossed around on the winds.

Yet something is changing. With the five-yearly European elections looming next month, the EU is for the first time in ages closing in on something like a common purpose: une Europe qui protège, or “a Europe that protects”. What this means in practice, whether the EU can enact it and whether that is even desirable is all up for debate. But Europe has a new sense of direction.

That is the argument of Luuk van Middelaar in his new book “Alarums and Excursions”. The Dutch historian argues that improvising its way through a decade of emergencies has changed the EU . He describes these crises, and Brexit in particular, as a “Machiavellian moment”. The term belongs to John Pocock, a historian who coined it in 1975 to describe the point at which republics come to terms with their own mortality amid the “stream of irrational events”. Such states, argued Mr Pocock—using the examples of Renaissance Italian states, civil-war England and early republican America—suddenly recognise the need to fight for their own legitimacy and sovereignty.

Mr van Middelaar reckons that Europe’s “new awareness of the need to protect itself and its citizens” is one such moment. He traces the shift’s roots to the phone calls that flew between European capitals early on the morning after the Brexit vote in June 2016. “Jean, this isn’t looking good,” Martin Schulz, then the president of the European Parliament, told Jean-Claude Juncker, the president of the European Commission, at 7am. Then Europe’s long-restrained instinct for self-preservation kicked in. “What doesn’t kill you makes you stronger,” Donald Tusk, the president of the European Council, told journalists a couple of hours later. Over the following weeks Angela Merkel forged a common EU response to the vote, while Mr Tusk and Mr Juncker defended the union with gusto in speeches.

Europe, its leaders suddenly seemed to realise, needed to defend itself. And in turbulent times that meant better protecting its citizens from the seeming loss of control that had driven Britain’s voters to reject the union. Mr van Middelaar draws a line from the shock of the Brexit vote to much that followed: Mr Macron’s adoption of une Europe qui protège as a response to populism, Mrs Merkel’s comments in May 2017 that Europe could no longer rely on others (meaning America) for its security, and “recent decisions on border protection, foreign investment screening and defence co-operation”. Noting that support for the EU has risen since Britain voted to leave, he writes: “An awareness is growing that European security and ‘sovereignty’ are not a given.”

Mr van Middelaar overstates Brexit’s role. Major elements of the protective European agenda, like stronger border security and the regulatory crackdown on American digital giants, predate June 2016. Other elements, like the new suspicion of China and tentative shifts towards EU -wide defence, are a response to geopolitical shifts far beyond Europe. But his underlying observation is right: the union has rediscovered a sense of mission. Witness the new Franco-German manifesto for interventionist industrial policies; the EU ’s incoming “upload filter” strengthening online copyright laws; new money and powers for Frontex, the EU ’s external borders agency; and the EU -China summit on April 9th, where the EU pushed Beijing, to reduce distorting state subsidies and to stop obliging companies to transfer technology.

In the coming European election campaign politicians will compete less on whether the EU is a good thing (Brexit has curbed others’ appetite to flounce out) and more on how it can be used to shield the little guy from change. The far left will emphasise economic protection; the far right will stress repatriating immigrants; centrists like Mr Macron and Mrs Merkel will offer an array of milder economic and social protections. That election campaign will colour the next European Parliament and European Commission. From the institutional expansion of the 1990s and the geographic expansion of the 2000s, Europe is emerging from the crisis years of the 2010s with a new mission to retrench, consolidate and most of all protect—both itself and its citizens.

Easier said than done