The British sailor Alex Thomson has narrowly missed out on winning the Vendée Globe single-handed round-the-world yacht race. In his fourth attempt, Thomson was just 100 miles behind when the Frenchman Armel Le Cléac’h crossed the finish line at Les Sables d’Olonne on the west coast of France on Thursday afternoon.

It has been an epic battle. For 74 days and nearly 25,000 nautical miles, the two sailors have duelled, at one time within sight of each other.

The Vendée Globe is the ultimate test of human versus ocean. For week after week, competitors face not just the wind and the waves, but loneliness, Christmas away from their families, fatigue (sleep is grabbed, in minutes not hours, whenever possible). Plus there is stress, fear, frustration, boredom, noise, overuse of some muscles, underuse of others, freeze-dried vacuum-packed food, limited water and no proper toilet.

Banque Populaire VIII skippered by Le Cléac’h sails into Les Sables d’Olonne, France, 19 January. Photograph: Caroline Blumberg/EPA

Of the 29 sailors who set out from Sable d’Olonne on 6 November, 11 abandoned the race. No non-French sailor has ever won the Vendée Globe; the closest, now equalled by Thomson, was the British sailor Dame Ellen MacArthur who was second in the 2000-01 race. Le Cléac’h has been runner-up in the previous two series.

In the early stages of the race, Thomson and his cutting-edge 60ft yacht Hugo Boss appeared to have the speed advantage. But Le Cléac’h’s Banque Populaire gained the advantage when Thomson hit a “UFO” (unidentified floating object) in the Atlantic. He broke one of the foils, the scythe-like protrusions from the hull that lift it from the water and allow the boat to go faster and which are being used for the first time in the Vendée Globe’s 27-year history.

The French sailor continued to make gains after passing the Cape of Good Hope on the southern tip of Africa, in the race across the treacherous Southern Ocean, past Cape Leeuwin on the south-west tip of Australia and then across the Pacific.

Known as the Jackal because of his reputation for chasing and hunting down the opposition, this time Le Cléac’h was way out in front. At one point, he had a lead of more than 800 miles over Thomson. But after rounding Cape Horn, the Gosport-based Briton started to fight back and close the gap in the race back up the Atlantic. Hunting the Jackal.

Alex Thomson pictured in 2013 as he came third in the 7th Vendée Globe solo race. Photograph: Jean-Sebastien Evrard/AFP/Getty Images

In the sprint to the finish, Thomson broke the world record for the greatest distance sailed solo in 24 hours, notching up 536 miles, and by Wednesday he was snapping at the heels of Le Cléac’h, just 32 miles ahead.

But tricky weather conditions – an anticyclone forced the two boats way north of the shortest route, almost to the Isles of Scilly off Cornwall – plus faulty steering gear and extreme exhaustion, conspired to prevent his overhauling the French boat. “I don’t care about the finish right now, I just want to sleep,” he told the race website.

The Jackal escaped, to cross the finish line in a chilly north easterly breeze, amid an armada of spectator boats. Le Cléac’h’s time of 74 days and three hours smashed the previous race record by four days.

He kissed his boat and was then overcome with tears. “It was very, very, difficult with him because just at the end he was very near to him,” he said of his British rival. “He gave me a hard life during this moment and I’m very happy to win.”

Le Cléac’h’s two children scampered on board for the first hug from their dad for two and a half months, then he motored into harbour to a hero’s welcome from the thousands thronging the quayside, followed by a shower and a decent meal.

Thomson faced another night, or most of it, at sea. And spare a thought for Sébastien Destremau, currently in last place of the sailors still racing. Still in the Pacific Ocean, he has more than 9,000 miles still to go.