On the evening of 8 November, the world gathered in front of TV screens for the news. In the early hours of 9 November, it began to dawn on us that what we were watching was no longer news but history. Not since 9/11 could many recall such a sense of incredulous dread, and as Florida fell to Donald Trump, I found myself seized by an eerie premonition. I saw schoolchildren turning over history examination papers in the future, to find a question as predictable and familiar to their generation as one about the origins of the second world war had been to mine: “Identify and analyse the parallels,” it would read, “between the 1930s and the 2010s.”

No one yet knows how 2016 will be remembered, and if Boris Johnson turns out to be right, we will wonder why anyone ever worried about the arrival of another “liberal guy from New York” in the White House. If, however, pupils do one day have to answer that exam question, they might well begin by observing that we were every bit as slow as our forefathers to recognise impending catastrophe.

When David Cameron returned from Brussels in February, brandishing his peace-in-our-time renegotiated EU membership terms – can anyone now even remember what they were? – it looked as if the referendum promised nothing more sinister than the entertaining spectacle of the government tearing itself apart. No one was surprised to see Iain Duncan Smith, Chris Grayling, John Whittingdale and Theresa Villiers side with Vote Leave, but Michael Gove’s defection was a bombshell. When Johnson followed a day later, “after a huge amount of heartache”, the audacity of the pretence that he was acting on deeply held anti-EU conviction fooled nobody. As the columnist Nick Cohen put it after the vote, “There are liars, and then there’s Boris.”

David Cameron at the European Commission in January. Photograph: Laurent Dubrule/EPA

In Johnson’s defence, he wasn’t the only one exploiting Europe for personal ambition. Cameron’s motives for calling the referendum had little to do with principle and everything to do with neutralising Ukip’s threat and silencing internal dissent. Europe had been a toxic nuisance to Tory leaders for 40 years, and back in 2006 Cameron famously blamed “banging on about Europe” for his party’s unpopularity (“Instead of talking about the things that most people care about,” he declared, “we talked about what we cared about most”). By the time the campaign began, fevered speculation about its implications for the Tories left little room for much thought about the damage it could do to the country.

The remain campaign imagined they’d put this right by orchestrating a chorus of hair-raising warnings. Everyone from Mark Carney to Richard Branson, the TUC to the IMF, warned of economic Armageddon. Such a powerful consensus seemed so self-evidently persuasive to remain campaigners that when voters said they were fed up with Project Fear, they refused to believe them and wheeled out President Obama, only to give leave another boost in the polls. “Bring Obama back again!” Nigel Farage gloated gleefully. “Let’s have another visit!” The then Ukip leader was more attuned than most to the new populist mood of anti-elite resentment; and when Gove told us “the people of this country have had enough of experts”, liberals were so quick to ridicule him that few considered the possibility he might, in fact, be right.

Boris Johnson and Michael Gove after the Brexit vote. Photograph: Stefan Rousseau/AFP/Getty Images

In a year when the phrase “post-truth” entered the Oxford Dictionary, and fake news helped win the White House, facts were at best worthless and at worst a liability. Once again, many of us were slow to grasp the implications of this new paradigm. Focus groups of undecided voters told remain’s leaders that their minds would be made up by hard facts – and were taken at their word. Remain duly kept churning out data – Brexit would cost “£4,300 per household”, claimed George Osborne – apparently unaware that no one likes to think, let alone admit, that what really informs their decisions is much more elusive and emotional. In the febrile new mood of 2016, remain’s threat that you would lose “vital EU funding for the farming, scientific and medical research and programmes that make a real difference in your local community” was no match for the potent promise of leave’s “Take back control”.

Anti-Brexit protesters in Berlin. Photograph: Hannibal Hanschke/Reuters

For a fleeting moment, the campaign seemed almost festive, when Bob Geldof and Farage traded insults across the Thames from rival flotillas. The leave boats had Joey Essex on board, while the 60s soul song The In Crowd blasted out from Geldof’s. The referendum had everyone talking, and optimists could feasibly mistake the national conversation for a unifying moment. But seven days before the vote, the mood darkened. Ukip revealed its infamous Breaking Point poster, an almost exact copy of footage from a Nazi propaganda film; hours later, an idealistic young pro-EU Labour MP was shot and stabbed to death on the street in her constituency by a Nazi sympathiser shouting “Britain first”. Even Farage privately admitted that Jo Cox’s murder would finish off leave’s chances, and liberals, though deeply shaken, assumed such grotesque ugliness couldn’t fail to bring the country to its senses. All the polls agreed.

They were wrong. On 23 June, 52% of us chose instead to vote for chaos; by breakfast the following morning, the prime minister had resigned, and even Johnson and Gove looked shell-shocked. Within days, they would destroy one another in a Shakespearean bloodbath to succeed Cameron. Once Andrea Leadsom’s misapprehension that motherhood qualified her for the job had ruled her out, Theresa May was the only one left standing, and thus became our new prime minister.

A group hug after Cameron resigned. Photograph: Kirsty Wigglesworth/AP

But if the Tories’ leadership race was unedifying, Labour MPs could only look on with envy. Incensed by Jeremy Corbyn’s absenteeism during the referendum campaign, more than 60 resigned from the shadow front bench, and days later 172 voted no confidence in their leader. Corbynistas retaliated with a torrent of online abuse, much of it violent and misogynistic, and a brick through leadership challenger Angela Eagle’s window put paid to any hope of a “kinder, gentler politics”. After an inflammatory summer of courtroom battles, allegations of MI5 infiltrators, rock star-style Corbyn rallies and squabbles over a £25 fee to vote, Corbyn was duly re-elected Labour leader, and promptly vanished from view again.

Historians will probably argue for ever about why we voted to leave the EU, but none could conclude that immigration played little part. The 58% spike in hate crimes that followed the vote only confirmed what the result had already told us: our compassion for migrants had curdled into fearful hostility as the crisis in mainland Europe spiralled. Hungary declared a nationwide state of emergency, and Italy replaced Greece as the people traffickers’ destination of choice, with 180,000 reaching its shores this year. The likelihood of drowning while crossing the Med narrowed from the previous year’s record of one in 269, to just one in 88; but sympathy hardened as the crisis became fatally entwined in public minds with the Islamic terror attacks rocking the continent.

Seven of the nine jihadis who attacked Paris late last year, killing 130, were reported to have smuggled themselves into Europe disguised as Syrian refugees. In March, Brussels became the next target, when bombs at the airport and a metro station killed more than 30 and injured 300. But July was to be the deadliest month: Bastille Day celebrations on a balmy night in Nice became a massacre when a Tunisian man drove a truck into the crowds, killing 86 and injuring more than 400. Twelve days later, two 19-year-old jihadis forced an 85-year-old priest to kneel at his own altar in a Normandy church and slit his throat. In Germany, an Afghan asylum seeker ran amok with an axe on a train, a Syrian refugee blew up a wine bar, another hacked a colleague to death with a machete, and a German-Iranian teenage gunman went on a rampage, killing nine. Earlier this week, a Tunisian asylum seeker was was shot dead by Italian police after being identified as the man who drove a truck into a Berlin Christmas market, killing at least 12 people.

Measures that would only recently have been unthinkable were passed with little public protest. Denmark introduced a law authorising the confiscation of jewellery and cash from asylum seekers to pay for their care, undeterred by UN warnings against fuelling “fear and xenophobia”. French seaside resorts imposed a burkini ban, leading to the surreal spectacle of armed policemen ordering Muslim women on beaches to undress, which was reversed not by public revulsion (opinion polls found two-thirds of French people in favour) but a court ruling. When the migrant camp in Calais was bulldozed, Britain agreed to take its unaccompanied minors, only for our tabloids to whip up outrage about arrivals who didn’t “look” under 18. A Tory backbencher proposed subjecting them to dental tests, to determine if they were deserving of British kindness.

Wrecked boats and life jackets used by refugees crossing the Aegean, abandoned in Greece. Photograph: Aris Messinis/AFP/Getty Images

The three biggest nationalities pouring into Europe were fleeing conflicts caused by events long predating 2016 and not confined within their borders. Fifteen years after western coalition forces first sought revenge for 9/11, Afghanistan and Iraq remain locked in bloody turmoil, but it was the tragedy of Syria that horrified the world this year. Five years into civil war, the president, Bashar al-Assad, remained undefeated and the international community paralysed, unable to decide which, if any, side to support.

Diplomatic scruples did not inhibit Vladimir Putin, who was all too happy to fill the vacuum. Any hope that Russian airstrikes on Syria would be confined to Isis targets soon faded as Moscow subjected eastern Aleppo to the same ruthless bombardment that had once reduced Grozny to rubble. Cluster and barrel bombs rained down on civilian homes and hospitals, even a UN aid convoy, rendering Aleppo our Guernica and killing more civilians, according to one NGO monitoring the war (the UN-sanctioned Syrian Network for Human Rights), than even Isis has. The world was shaken by footage of a shell-shocked five-year-old boy being pulled from the wreckage of his home, coated in grey dust, dazed – but still it wasn’t moved to act. “All the world has failed us,” a resident of Aleppo despaired. “The city is dying. Rapidly by bombardment, and slowly by hunger and fear of the advance of the Assad regime.” As the year drew to a close, the fall of Aleppo to Assad became inevitable, and from the ruins of one of the world’s oldest cities rose a resurgent Kremlin, restored as a global superpower.

The bomb-damaged Bustan al-Basha district of Aleppo in November. Photograph: George Ourfalian/AFP/Getty Images

A once faintly ridiculous figure, mocked in the west for his fondness for posing topless, Putin could plausibly claim to be the most influential world leader of 2016. For the first time in history, a Russian president was accused of deploying cyber warfare to influence the outcome of a US presidential election. Putin denied the CIA’s charge, but few in Washington doubted that he was behind the Russian hackers who infiltrated Democratic National Committee email servers and the private email account of Hillary Clinton’s campaign chairman, releasing material calculated to embarrass and undermine their candidate. Her rival had even urged Moscow to hack her account: “Russia, if you’re listening,” he declared at a press conference in July, “I hope you’re able to find the 30,000 emails that are missing.” In the words of one stunned Clinton aide: “This has to be the first time that a major presidential candidate has actively encouraged a foreign power to conduct espionage against his political opponent.”

Vladimir Putin with Trump’s secretary of state, ExxonMobil CEO Rex Tillerson. Photograph: Sasha Mordovets/Getty Images

But it was only one of many firsts in a US presidential election unlike any the world had seen. When Donald J Trump entered the race, few imagined the reality star and property tycoon with four business bankruptcies and two ex-wives behind him stood a chance against the most qualified Democratic candidate in history. This would be the year America elected its first female president, not the first leader of the free world to have never held public office. Pundits shook their heads and laughed back in January when Trump told a rally, “I could stand in the middle of 5th Avenue and shoot somebody and I wouldn’t lose any voters.” Who was he kidding? Every bizarre step he took towards November’s vote was judged by sniggering pundits to be leading him farther from the White House.

Build a wall on the Mexican border to keep out all those Latino rapists? The idea was surely absurd. Punish women for having abortions? Even pro-lifers were appalled. July’s Republican Convention was meant to confer respectability on Trump’s maverick campaign, but unravelled into farce after his wife, Melania, delivered a speech lifted verbatim from one Michelle Obama made eight years earlier. Matters only got worse when Trump launched a Twitter attack on the Muslim parents of a US soldier killed fighting in Iraq. The following week he suggested a Clinton presidency could be dealt with by “the Second Amendment people”, by which he could only mean that they assassinate her.

When a tape emerged of Trump boasting in 2005 about grabbing women “by the pussy” and getting away with it because he was famous, he retaliated by inviting three women who had accused Bill Clinton of inappropriate sexual conduct to the next presidential debate. The tape was nothing but “locker room banter”, Trump scoffed, showcasing his unparalleled gift for post-truth politics with the solemn assertion: “Nobody has more respect for women than I do.” He announced his intention to jail Clinton if he won. Even George W Bush’s former secretary for homeland security was appalled: “It smacks of what we read about tinpot dictators in other parts of the world.”

Trump dismissed as “liars” the 12 women who came forward to accuse him of having acted out his banter. Some, he sneered, weren’t even good-looking enough for him to sexually assault. “Look at her,” he mocked one. Of another: “That would not be my first choice.” In the campaign’s final weeks, what caution he ever had was thrown to the wind, as he led rallies in a mob chant of “Lock her up!”, “Build that wall!” and “Drain the swamp!” Channelling his new best friend Farage, he urged America to make 8 November “our independence day”.

Donald Trump after winning the US election. Photograph: Saul Loeb/AFP/Getty Images

As Noam Chomsky observed, “Every time Trump makes a nasty comment about whoever, his popularity goes up. Because it’s based on hate, you know. Hate and fear,” he warned, “reminiscent of something unpleasant: Germany, not many years ago.” Yet even at the 11th hour, when the FBI reopened its investigation into Clinton’s private email server, the polls still assured the world Trump could not win. And then, on 8 November, a man widely described as a sociopathic bully, grandiose narcissist, dangerous demagogue and pathological liar, who scored higher than Hitler in an Oxford University study of psychopathic tendencies, became the 45th president of the USA. It was indeed “Brexit plus plus plus”, celebrated by America’s white supremacist “alt-right” movement with cries of “Hail Trump!” and rigid one-armed Nazi salutes. In the words of veteran constitutional historian Professor Vernon Bogdanor, Trump’s election was “the most troubling political event in my lifetime. It’s not difficult to arouse nationalist passions. We saw that in the 1930s.”

The world waits to see whether President Trump will govern as he campaigned. So far he has appointed a Texan oilman and Putin ally as secretary of state, put a retired general nicknamed Mad Dog in charge of defence, a climate change denier in charge of the Environmental Protection Agency, and chosen for his chief strategist the head of Breitbart news. His foreign heroes are Putin and Farage, and his preferred medium for conducting international diplomacy is Twitter. At the very moment when America’s system of checks and balances has never been more necessary, his party controls the White House, the house and the senate.

Hillary Clinton at a fundraiser in October. Photograph: Brendan Smialowski/AFP/Getty Images

Meanwhile, the global institutions designed to keep us safe are in trouble. The UN secretary general used to be a household name, but Ban Ki-moon’s only discernible achievement in eight years was to make himself and the UN so invisible that most of the world would struggle to recognise, let alone name, his successor taking office in January. (It’s António Guterres.) The head of the IMF, Christine Lagarde, has gone on trial in France charged with criminal negligence, and Nato’s member states have failed to pay their dues for so long that they could hardly be surprised by Trump’s reluctance to carry on bankrolling an “obsolete” institution costing the US “a fortune”. The fourth estate’s future has become increasingly fragile, too, as readers and viewers defected to the raunchier wilds of social media, and politicians from left and right discovered they could escape scrutiny from the mainstream media by simply snubbing it. When Facebook is the primary source of many voters’ news, and a conspiracy theory as crazy as Pizzagate (which linked Hillary Clinton and other Democrats to a child-abuse network run from a Washington pizzeria) can command global attention, how the powerful will be held to account is no longer clear.

If western liberal democracy reached its high point with the fall of the Berlin Wall, by the end of this year its very survival began to look in doubt. As Timothy Garton Ash put it, 2016 was “1989 in reverse”. The far right is on the rise across Europe; Marine Le Pen is a frontrunner in 2017’s French presidential election; and even if Angela Merkel holds on to power next year, the anti-immigration, populist, far-right Alternative for Germany is predicted to win seats in the Bundestag. It is with this fractured and fractious EU that Britain will negotiate the terms of its departure, cheered on by flag-waving tabloids, unconstrained by a functioning opposition, and we will finally find out what “Brexit means Brexit” means.

How did all of this happen? Following David Bowie’s death in January, and Britain’s vote to leave in June, the actor Paul Bettany tweeted one suggestion: “In January I dismissed my mate’s theory that David Bowie was the glue holding the universe together but I don’t know man... I don’t know.” After so many shockwaves and dramas, it was tempting to view the year as a freak surge of ahistorical exceptionalism, analogous to nothing and a law unto itself. History will see it differently. Just as the legacy of the great crash of 1929 took several years to manifest itself, so the consequences of the financial crash of 2008 are only now becoming clear. There was nothing magical or inexplicable about 2016. We were merely reminded of what happens when most of us do not have enough money, and a few of us have much too much.

Additional research by Matilda Munro

• Where did it all go right? For a more positive view of the world in 2017, follow the Guardian’s Half Full online series, with reports on innovative ideas and solutions to the challenges of the day. Wishing you all a happier new year.