Mr Donald Trump's stunning electoral defeat of Mrs Hillary Clinton marks a watershed not just for American politics, but for the entire world order. We appear to be entering a new age of populist nationalism, in which the dominant liberal order that has been constructed since the 1950s has come under attack from angry and energised democratic majorities. The risk of sliding into a world of competitive and equally angry nationalisms is huge, and if this happens it would mark as momentous a juncture as the fall of the Berlin Wall in 1989.
The manner of Mr Trump's victory lays bare the social basis of the movement he has mobilised. A look at the voting map shows Mrs Clinton's support concentrated geographically in cities along the coasts, with swathes of rural and small-town America voting solidly for Mr Trump. The most surprising shifts were his flipping of Pennsylvania, Michigan and Wisconsin, three northern industrial states that were so solidly Democratic in recent elections that Mrs Clinton didn't even bother to campaign in the latter one. He won by being able to win over unionised workers who had been hit by deindustrialisation, promising to "make America great again" by restoring their lost manufacturing jobs.
We have seen this story before. This is the story of Brexit, where the pro-Leave vote was similarly concentrated in rural areas and small towns and cities outside London. It is also true in France, where working-class voters whose parents and grandparents used to vote for the Communist or Socialist parties are voting for Ms Marine Le Pen's National Front.
But populist nationalism is a far broader phenomenon than that. Russian President Vladimir Putin remains unpopular among more educated voters in big cities such as St Petersburg and Moscow, but has a huge support base in the rest of the country. The same is true of Turkey's President Recep Tayyip Erdogan, who has an enthusiastic support base among the country's conservative lower middle class, and Hungary's Prime Minister Viktor Orban, who is popular everywhere but in Budapest.
Social class, defined today by one's level of education, appears to have become the single most important social fracture in countless industrialised and emerging-market countries. This, in turn, is driven directly by globalisation and the march of technology, which has been facilitated in turn by the liberal world order created largely by the United States since 1945.
When we talk about a liberal world order, we are speaking about the rules-based system of international trade and investment that has fuelled global growth in recent years. This is the system that allows iPhones to be assembled in China and shipped to customers in the US or Europe in the week before Christmas. It has also facilitated the movement of millions of people from poorer countries to richer ones, where they can find greater opportunities for themselves and their children. This system has worked as advertised: Between 1970 and the 2008 financial crisis, global output of goods and services quadrupled, bringing hundreds of millions of people out of poverty, not just in China and India but also in Latin America and sub-Saharan Africa.
There remain a number of large uncertainties with regard to this new America. While Mr Trump is a consistent nationalist at heart, he is also very transactional. What will he do when he discovers that other countries will not renegotiate existing trade pacts or alliance arrangements on his terms?
But as everyone is painfully aware now, the benefits of this system did not filter down to the whole population. The working classes in the developed world saw their jobs disappear as companies outsourced and squeezed efficiencies in response to a ruthlessly competitive global market.
This long-term story was hugely exacerbated by the US sub-prime crisis of 2008, and the euro crisis that hit Europe a couple of years later. In both cases, systems designed by elites - liberalised financial markets in the US case, and European policies such as the euro and the Schengen system of internal migration - collapsed dramatically in the face of external shocks. The costs of these failures were again much more heavily borne by ordinary workers than by the elites themselves. Ever since, the real question should not have been why populism has emerged in 2016, but why it took so long to become manifest.
In the US, there was a political failure insofar as the system did not adequately represent the traditional working class. The Republican Party was dominated by corporate America and its allies who had profited richly from globalisation, while the Democrats had become the party of identity politics - a coalition of women, African-Americans, Hispanics, environmentalists and the LGBT community - that lost its focus on economic issues.
The failure of the US left to represent the working class is mirrored across Europe. European social democracy had made its peace with globalisation a couple of decades ago, in the form of Blairite centrism or the kind of neoliberal reformism engineered by German chancellor Gerhard Schroeder's Social Democrats in the 2000s.
But the broader failure of the left was the same one made in the lead-up to 1914 and the Great War, when, in the apt phrase of the British-Czech philosopher Ernest Gellner, a letter sent to a mailbox marked "class" was mistakenly delivered to one marked "nation". Nation almost always trumps class because it is able to tap into a powerful source of identity, the desire to connect with an organic cultural community. This longing for identity is now emerging in the form of the American alt-right, a formerly ostracised collection of groups espousing white nationalism in one form or another. But even short of these extremists, many ordinary American citizens began to wonder why their communities were filling up with immigrants, and who had authorised a system of politically correct language by which one could not even complain about the problem. This is why Mr Trump got a huge number of votes from better-educated and more well-off voters as well, who were not victims of globalisation but still felt their country was being taken from them. Needless to say, this dynamic underlay the Brexit vote as well.
So what will be the concrete consequences of the Trump victory for the international system? Contrary to his critics, Mr Trump does have a consistent and thought-through position: He is a nationalist on economic policy, and in relation to the global political system. He has clearly stated that he will seek to renegotiate existing trade agreements such as Nafta and presumably the WTO, and if he doesn't get what he wants, he is willing to contemplate exiting from them. And he has expressed admiration for "strong" leaders such as Mr Putin who nonetheless get results through decisive action. He is correspondingly much less enamoured of traditional US allies such as those in Nato, or Japan and South Korea, whom he has accused of free-riding on American power. This suggests that support for them will also be conditional on a renegotiation of the cost-sharing arrangements now in place.
The dangers of these positions for both the global economy and for the global security system are impossible to overstate. The world today is brimming with economic nationalism. Traditionally, an open trade and investment regime has depended on the hegemonic power of the US to remain afloat. If the US begins acting unilaterally to change the terms of the contract, there are many powerful players around who would be happy to retaliate, and set off a downward economic spiral reminiscent of the 1930s.
The danger to the world security system is as great. Russia and China have emerged in the past decades as leading authoritarian great powers, both with territorial ambitions. Mr Trump's position on Russia is particularly troubling: He has never uttered a critical word about Mr Putin, and has suggested that his takeover of Crimea was perhaps justified. Given his general ignorance about most aspects of foreign policy, his consistent specificity with regard to Russia suggests that Mr Putin has some hidden leverage over him, perhaps in the form of debts to Russian sources that keep his business empire afloat. The first victim of any Trumpist attempt to "get along better" with Russia will be Ukraine and Georgia, two countries that have relied on US support to retain their independence as struggling democracies.
More broadly, a Trump presidency will signal the end of an era in which the US symbolised democracy itself to people living under corrupt authoritarian governments around the world. American influence has always depended more on its "soft power" rather than misguided projections of force like the invasion of Iraq. America's presidential choice signifies a switching of sides from the liberal internationalist camp to the populist nationalist one. It is no accident that Mr Trump was strongly supported by Ukip's Nigel Farage, and that one of the first people to congratulate him was the National Front's Ms Le Pen.
Over the past year, a new populist-nationalist internationale has appeared, by which like-minded groups share information and support across borders. Mr Putin's Russia is one of the most enthusiastic contributors to this cause, not because it cares about other people's national identity, but simply to be disruptive. The information war that Russia has waged through its hacking of Democratic National Committee e-mails has already had a hugely corrosive effect on American institutions, and we can expect this to continue.
There remain a number of large uncertainties with regard to this new America. While Mr Trump is a consistent nationalist at heart, he is also very transactional. What will he do when he discovers that other countries will not renegotiate existing trade pacts or alliance arrangements on his terms? Will he settle for the best deal he can get, or simply walk away? There has been a lot of talk about the dangers of his finger on the nuclear trigger, but my sense is that he is much more isolationist at heart than someone eager to use military force around the world. When he confronts the reality of dealing with the Syrian civil war, he may well end up taking a page from the Obama playbook and simply continue to sit this one out. This is the point at which the matter of character will come into play. Like many other Americans, I find it hard to conceive of a personality less suited to be the leader of the free world. This stems only in part from his substantive policy positions, as much from his extreme vanity and sensitivity to perceived slights. Earlier this month, when on a stage with Medal of Honour winners, he blurted out that he too was brave, "financially brave". He has asserted that he wants payback against all his enemies and critics. When faced with other world leaders who will slight him, will he react like a challenged Mafia boss, or like a transactional businessman?
Today, the greatest challenge to liberal democracy comes not so much from overtly authoritarian powers such as China, as from within. In the US, Britain, Europe, and a host of other countries, the democratic part of the political system is rising up against the liberal part, and threatening to use its apparent legitimacy to rip apart the rules that have heretofore constrained behaviour, anchoring an open and tolerant world.
The liberal elites that have created the system need to listen to the angry voices outside the gates and think about social equality and identity as top-drawer issues they must address.
One way or the other, we are going to be in for a rough ride over the next few years.
• Francis Fukuyama is a senior fellow at Stanford's Freeman Spogli Institute and author of Political Order And Political Decay.