The race to be France's next president came at the end of a tense campaign with multiple twists and turns.
The first upset came last November when former premier Francois Fillon pulled off a come-from-behind victory in the right-wing primary, defying pollsters who had for months predicted a win for Mr Alain Juppe, 71.
The upset was put down to strong performances in television debates, and what was then a scandal- free image compared with Mr Juppe and his other rival, former president Nicolas Sarkozy.
HOLLANDE DUCKS OUT
Socialist President Francois Hollande had staked his presidency on turning the moribund economy around, in particular on reining in unemployment, which has remained at around 10 per cent throughout his five years in charge.
When he failed to do so and France also became a frequent target for terrorist attacks, his popularity ratings plunged to historic lows. On Dec 1, he said that he would not seek re-election.
SCANDAL HITS FILLON
By mid-January, the presidential race seemed to be a duel between Mr Fillon and anti-immigration candidate Marine Le Pen.
At the time, Mr Emmanuel Macron, a former economy minister under Mr Hollande who had quit to launch an independent centrist bid for the presidency, was just beginning to gain traction in the race.
On Jan 25, investigative newspaper Le Canard Enchaine dropped a bombshell with revelations that Mr Fillon, 63, had put his wife on the public payroll with little work to show for it.
It would lead to criminal charges being brought against him for abuse of public funds. His support never recovered and he finished third in the first round.
MACRON BREAKS THROUGH
By early February, Mr Macron, 39, began doing better in opinion polls than Mr Fillon. The former banker hoping to become France's youngest post-war president was once dismissed as a flash in the pan but went on to consolidate his status as the man to beat.
The pro-business europhile began filling arenas, finding support from Socialists deserting their crumbling party as well as a broad array of people seeking new ideas.
Communist-backed firebrand Jean-Luc Melenchon, 65, surged in the polls in the final weeks before the first round of voting on April 23.
Tapping into widespread disillusionment with the political class, he bounded ahead after strong debate appearances and quirky campaign stunts using holograms. He eventually came in fourth behind Mr Fillon with 19.58 per cent of the vote.
TERROR IN THE HOME STRAIGHT
Just as candidates were making their final pitches to voters in a televised interview show on April 20, a gunman opened fire on police on the Champs Elysees, killing one officer before being shot dead himself. A note praising the Islamic State in Iraq and Syria was found near him.
The killing forced the issue of security back into the race after nine months without a major attack.
TRADITIONAL PARTIES ROUTED
Mr Macron and Ms Le Pen topped the first round of voting, eliminating France's main traditional parties at that stage for the first time since 1958.
The conservative Republicans blamed Mr Fillon for his third-place finish, while the ruling Socialists were left in crisis after their candidate came in a humiliating fifth.
BATTLE OF AMIENS
When campaigning for the second round began, a picket line at a Whirlpool tumble-dryer factory in Mr Macron's northern hometown of Amiens was the scene of one of the election's most dramatic moments. Ms Le Pen made a surprise whirlwind visit to the workers as Mr Macron met unions to discuss the plant's future.
He arrived afterwards and was mobbed by the workers, who initially booed him. Mr Macron eventually managed to turn the situation around and engage them in dialogue about the pros and cons of globalisation.
In an often-vicious televised debate last Wednesday, Ms Le Pen branded her rival "the candidate of the elite". Mr Macron hit back, accusing her of being "the heir of a system which has prospered from the fury of the French people for decades".
MASSIVE HACKING ATTACK
Last Friday, thousands of internal documents from the Macron campaign were leaked online. His team said hackers took the e-mails, accounting details and other records as part of a "massive and coordinated" effort aimed at influencing the election's outcome.
In Pictures: France goes to the polls str.sg/frenchpix
What you need to know about the election str.sg/42Cw