While the world celebrates and commiserates a Donald Trump presidency, one thing is clear: this will go down as the most acrimonious presidential campaign of all.

Was it the emails that finally turned the tide? Donald Trump’s insistence on building a wall may have first pushed voters to Hillary Clinton, but WikiLeaks may well have swung them back the other way.

Since Mr Trump and his wife glided down the escalator at Trump Tower to announce his candidacy for president on 16 June last year, the candidates have fought tooth and nail to bring each other down.

Below is the timeline of how the battle was fought and lost over the last 18 months.

12 April 2015: Hillary Clinton says she is running for a second time

After losing to Barack Obama in the presidential campaign in 2008, Clinton said she was aiming for the White House again in 2016.

“Americans have fought their way back from tough economic times but the deck is still stacked in favour of those at the top. Everyday Americans need a champion, and I'm going to be that champion,” she said in the video.

16 June 2015: Donald Trump announces his run for the White House, and starts off a negative campaign against Mexicans

“They’re bringing drugs. They’re bringing crime. They’re rapists. And some, I assume, are good people.”

These words, applauded by his supporters at Trump Tower, were indicative of what was to come – a torrent of insults and disparaging remarks against Mexican people and his popular proposal to build a high wall along the US-Mexican border.

“Build that wall!” soon became the chant of choice at his rallies.

Mexicans burn Donald Trump

2 February 2016: Martin O’Malley quits presidential race

The “distant Democrat” in third place, Martin O’Malley quit the race during the Iowa caucuses, leaving the floor wide open for Hillary Clinton and Bernie Sanders.

The former Baltimore mayor received just 1 per cent in the caucuses.

18 February 2016: Donald Trump and the Pope have a spat

Pope Francis Questions Donald Trump's Christianity

After Pope Francis suggested that anyone who wanted to build a wall “is not Christian”, the candidate fired back that it was “disgraceful” for a religious leader to question a person’s faith.

Mr Trump arguably set off the disagreement by calling the Pope “a very political person”. The row was arguably playing with fire as Mr Trump worked hard to secure the Evangelical votes.

25 February 2016: Ms Clinton confronted over her “superpredator” comment

A Black Lives Matter protester called out “I’m not a superpredator, Hillary!” at a South Carolina fundraiser, forcing the candidate to address her 1996 remarks that fed into a 1990s ideology that young African Americans with a criminal record were irredeemable and would terrorise communities.

Ms Clinton later told The Washington Post: “Looking back, I shouldn’t have used those words, and I wouldn’t use them today.”

4 May 2016: Last Republican opponent standing, John Kasich, quits race

Trailing by 900 delegates and only winning the vote in his home state, the Ohio governor called it a day and Mr Trump announced himself the presumptive Republican nominee. Mr Kasich quit the same week as Ted Cruz, after Mr Cruz was defeated in a clean sweep in the Indiana primary.

Mr Kasich and Mr Cruz hung on the longest after many other Republicans dropped out, including New Jersey governor Chris Christie and Florida senator Marco Rubio.

2 June 2016: Mr Trump questions objectivity of judge because he is of Mexican heritage

Mr Trump said that Judge Gonzalo Curiel ruling over the case relating to his now defunct Trump University would not be able to rule fairly, as he was of Mexican heritage.

“I’m building a wall. It’s an inherent conflict of interest,” he told The Wall Street Journal. The criticism of the judge, who was born in Indiana, caused Republicans embarrassment.

Donald Trump labels Mexican criminals ‘bad hombres’ to much derision

5 July 2016: Ms Clinton let off hook over emails

After a long investigation involving at least 33,000 of Ms Clinton’s emails, FBI director James Comey said the candidate had shown “extreme recklessness” regarding the misuse of her personal email server. He said her behaviour could also have resulted in adversaries hacking top secret and classified information.

Nonetheless he said that “no reasonable prosecutor” would bring charges against her. The Justice Department followed this guidance and the investigation was closed.

Her critics said she was let off too lightly.

FBI director says 'no charges' for Hillary Clinton amid email scandal

18 July 3016: Melania Trump plagiarises Michelle Obama’s speech

At the Republican National Convention, all eyes were on the potential first lady and wife of Donald Trump as she made her keynote speech.

Within minutes afterwards, reports were pouring in that she had copied Michelle Obama’s 2008 speech from the Democratic National Convention and it matched, almost word for word.

The next day, the Trump campaign penned a statement, blaming staffer Meredith McIver for the gaff. Ms Trump did not make another big speech until 3 November.

Michelle melania speech plagiarized

24 July 2016: Emails of the Democratic National Committee are hacked

In a cyber attack just days before the Democratic National Convention, DNC chair Debbie Wasserman Schultz was exposed in an attempt to collude with the media to oust Senator Sanders by smearing him as an atheist with southern voters. Ms Schultz resigned and was booed off the stage at a speech about the economy in Florida.

The FBI investigated whether Russia was behind the leak. Mr Trump then was accused of “treason” for encouraging Russia at a rally to hack Ms Clinton’s emails. He later said he was only being “sarcastic”.

28 July 2016: Bernie Sanders quits race

Ms Clinton’s rival drops out of the race, saying he would work with her to defeat Mr Trump.

More than 13 million people voted for the Vermont senator in the party's primaries and caucuses, and Ms Clinton faced an uphill battle in trying to woo them to her side. Many millennials chose to vote for the independent candidates, Jill Stein or Gary Johnson, instead.

The silver lining was that Ms Clinton shifted her policies significantly to the left, promising, for example, to eradicate student tuition fees for those earning less than $125,000 (£100,000).

Bernie Sanders says Trump Presidential campaign about 'bigotry'

9 August 2016: Mr Trump suggests gun supporters could kill Ms Clinton

At a rally, Mr Trump warned his followers that Ms Clinton would pick liberal-minded Supreme Court justices to replace the late Antonin Scalia.

“If she gets to pick her judges, nothing you can do, folks,” Mr Trump said, as the crowd began to boo. He quickly added: “Although the Second Amendment people – maybe there is, I don’t know.”

His comment sparked a wave of condemnation from Democrats and gun advocates alike, who said he was encouraging violence against his opponent.

19 August 2016: Mr Trump reaches out to black voters

Mr Trump went to Ohio to woo black voters, peddling the notion that things could not get any worse so they might as well vote for him.

“What the hell do you have to lose?” he asked. “You're living in poverty, you have no jobs, your schools are no good. If you keep voting for the same people, you will keep getting exactly the same result.”

He ranked consistently low with black voters, but said he was confident he would have 95 per cent of the black vote within four years. In later speeches, including during the presidential debates, he insisted that “law and order” was necessary to eradicate crime in inner cities.

9 September 2016: Ms Clinton calls Trump supporters a ‘basket of deplorables’

Speaking at a fundraiser in New York City, the Democrat said that half of Trump supporters were deplorable, sparking harsh criticism that she was speaking ill of the people she wanted to serve as president.

“You know, to just be grossly generalistic, you could put half of Trump’s supporters into what I call the basket of deplorables. Right? The racist, sexist, homophobic, xenophobic, Islamaphobic – you name it. And unfortunately there are people like that. And he has lifted them up.”

11 September 2016: Hillary Clinton’s health is in question

After weeks and even months of peddling conspiracy theories about Ms Clinton’s health, she was seen to buckle at the knees and was carried into a car at the 9/11 memorial service in New York.

Mr Trump imitated her unsteady walk at a rally, and said she was not physically well enough to be president. The theme was pursued by “medical experts” in white lab coats on Fox News.

Both candidates released letters from their doctors. Ms Clinton released information on her healthy heartbeat and blood pressure, while Mr Trump’s personal physician said he took five minutes to write the record and wrote that he would be the “healthiest president” the country has ever had.

Clinton faints as she leaves 9-11 memorial

26 September 2016: Mr Trump admits using loophole to avoid paying tax

Addressing speculation that he had managed to not pay federal income tax for almost two decades after making a loss of almost $1bn in 1995, Mr Trump said that “of course” he took advantage of a tax loophole.

His allies, including Mike Pence and Rudy Giuliani, said the move made him “smart” and a “genius”.

Mr Trump, unlike his rival and even Mr Pence, failed to release his tax returns and claimed his lawyer had instructed him not to release them while they were under audit.

October 2016: I'm a star, I can do what I like

An Access Hollywood video from 2005 showed Mr Trump bragging to Billy Bush on a bus that as a “star” he could do whatever he wanted to women, including grabbing their genitals.

House speaker Paul Ryan announced he could no longer defend Mr Trump, but he did not withdraw his endorsement.

The video also prompted a slew of sexual assault allegations from more than a dozen women, which Mr Trump denied. He threatened to sue the women and the outlets that published the claims after the election was over.

Melania Trump dismisses husband's leaked audio as 'boy's talk'

28 October 2016: FBI director drops another email bombshell

Mr Comey, in a letter to a select group of Republicans, said his team had found more emails that were “pertinent” to the closed investigation of Ms Clinton.

The case was “unrelated” he said, and did not say what the emails were about or how long the investigation would take.

The emails were found by the FBI while they were investigating disgraced Democrat Anthony Weiner, who had allegedly sent sexual text messages to a 15-year-old girl. He announced his separation from wife Huma Abedin, Ms Clinton’s top aide, in August.

The Clinton campaign has called for more transparency and said it was “extraordinary” to make the announcement so soon before the election.

2 November 2016: Woman accusing Mr Trump of child rape close to speaking publicly

The accuser in her mid-30s, who said Mr Trump raped her when she was 13 years old at a party of billionaire and convicted felon Jeffrey Epstein, planned to read her statement but then failed to show at the press conference. Her lawyer said her client feared for her life and had received some “terrible threats”.

The allegations, which were filed in court, were largely uncovered by the media due to the circus-like process of the lawsuit and the accuser’s anonymity, despite covering the allegations from other women.

Mr Trump’s lawyer said the claim was a “hoax”.

6 November 2016: FBI clears Mrs Clinton of any criminal wrongdoing

In a letter to Congress, FBI director James Comey said the FBI had completed its assessment of a further batch of the Democratic candidate’s emails and “have not changed our conclusion” .

A Clinton spokesman said her campaign team was “glad this matter is resolved”, while Republican rival Donald Trump criticised the announcement, arguing: “You can’t review 650,000 emails in eight days.”

8 November 2016: Donald Trump is voted as president

A plethora of swing states were won by Mr Trump, including North Carolina, Ohio and Pennsylvania.