A century from former England Test captain Sir Alastair Cook helped secure Essex Eagles’ progress into the knockout stages of the Royal London Cup following an extraordinary tie with Lancashire at Emirates Old Trafford.

Essex, who were eight wickets down, had required 22 off the last over to win before Simon Harmer stepped up and hit three successive straight sixes off Steven Croft with a scrambled two off the last ball leaving the scores level.

The result meant the visitors finish second in Group A behind leaders Durham and will play a home tie against the third-placed team in Group B.

But it was heartbreak for Lancashire, who had to win to qualify, as they drop to fourth in Group A, with Tom Bailey’s side’s total of 250 for six always looking a shade under par.

The hosts endured a stodgy start with Jack Plom and Ben Allison’s accuracy justifying Essex’s decision to field first.

The opening pair had battled their way to 49 when Harmer struck in the 16th over to remove Luke Wells with a beautifully flighted turner for 26 which brought Croft to the middle.

Together with Josh Bohannon, the veteran batsman took the game to the visitor’s bowlers before the opener scooped a full toss from Ryan ten Doeschate straight to Harmer at mid-off for 34.

When a frenetic Rob Jones was caught soon after for three thanks to a one-handed effort by Josh Rymell off ten Doeschate it looked like the innings could go either way until the incoming George Lavelle had other ideas.

The 21-year-old quickly took a liking to Aron Niijar and at one stage deposited the unfortunate spinner into the balcony of the famous Emirates Old Trafford pavilion for a massive six as he and Croft built an entertaining century partnership for the fourth wicket.

By the time Lavelle holed out to Paul Walter on the leg side boundary for 52, Lancashire had progressed to 203 and with Danny Lamb keen to keep up the momentum with a flurry of innovative shots the host’s were creeping towards respectability.

Croft eventually fell seven short of his century hitting out in the penultimate over with Lamb dismissed three balls later as Lancashire closed on 250 for six.

In reply Cook and Rymell had eased their way to 44 off 8.3 overs when the 20-year-old edged Baily to Wells at slip, before Essex suffered a severe wobble with Tom Westley trapped in front by Jack Morley for 19 and Feroze Khushi run out by Bohannon for 10 following a mix-up with Cook.

When Walter was dismissed by a stunning one-handed catch at point from Taylor Cornall, Essex looked in trouble, but with Cook joined by ten Doeschate, the experienced pair were able to add 89 runs for the fifth wicket and take the Eagles to what looked a secure position at 212 for five with 33 balls left when the Dutch international was out for 45.

But as scoreboard pressure increased, the Eagles plummeted as Cook (110) and Adam Wheater fell in successive deliveries to Croft’s off spin and Nijjar skied Wells to Liam Hurt off his first ball before Harmer’s heroics ensured a thrilling finish.

Essex head coach, Anthony McGrath, said: "It's been a really good competition and looking up and down the country there have been some really tight finishes and today was no different.

"At one point it looked like we were cruising along and then going into the last two overs the game was gone so for Simon (Harmer) to hit three sixes to the longest part of the ground was incredible.

"I must admit I thought we were gone at that point but Simon writes his own scripts and it was some great ball striking - he was actually disappointed he didn't hit the last one for six to get the win!

"Alastair batted really well and so did Steven Croft for Lancashire because it was tough out there especially against the spin. From ball one Alastair hit his straps well and it was a fantastic innings.

"We just wanted to qualify and we know whoever we get in the knockout stages it's going to be tough. Now we know what's in front of us and it's a quarter-final, a semi-final and a final and we have to win three games to win a trophy. Whoever we get we'll look forward to the challenge."