Will Jacks cracked a magnificent 80 from 57 balls but Surrey’s hopes of reaching the Royal London One-Day Cup knockout stages expired at the Kia Oval on Wednesday night.

The 19-year-old ensured Glamorgan’s 266-8 was overhauled with 58 balls to spare, winning by five wickets, but his county’s hopes depended not only on how they got on against the South Group’s basement side.

They needed two other results to go their way but neither did, Somerset also being disappointed as their win over leaders Hampshire counted for nothing, Essex beating already-qualified Kent to make up the three clubs who will go up against Worcestershire, Warwickshire and Yorkshire in the knockout stages.

Surrey had reached the final for the past three years, only to lose each time, but their hopes of a first trophy for seven years now hang on the Vitality T20 Blast and the Specsavers County Championship, which restarts on Saturday with a trip to Hampshire.

A 220-run hammering by Kent at Beckenham on Friday – Surrey’s heaviest one-day reverse – had left Rory Burns’s men in a desperate scramble to reach the knockout stages, a situation only partly eased by overcoming Middlesex by five wickets at Lord’s 48 hours later. The hosts were dismissed for 234, Tom Curran claiming 4-33, with Ben Foakes (86) and Ollie Pope (57no) sharing a fifth wicket stand with 98 in 19 overs to secure victory with 11 balls to spare.

Their fate out of their hands, Surrey had to beat Glamorgan and hope, the Welshmen lifted to 288-5 in 50 overs by Connor Brown’s doughty 98, in front of a crowd of around 5,000.

Despite losing the desperately out of touch Mark Stoneman early, the hosts were given an electrifying start by Jason Roy (23) and Jacks, who had announced his arrival in the county game by hitting a century against Gloucestershire earlier in the competition.

By the time he had cracked 12 fours and two sixes in a 57-ball stay, Surrey were well on their way with Burns (68), Foakes (30), Pope (31no) and new Test cap Sam Curran (22no) finishing the job quickly.

Burns admitted: “It was a really good performance but we are, of course, very disappointed not to qualify. Last year we just managed to squeeze into the quarter-finals but this time we have just come up short and so we’ve missed out.

“I think, to sum up our competition, it is true to say that when we’ve been good we’ve been very good – but when we’ve been off our game we’ve been really off.”