A Jim Allenby half-century and four for 33 from Dean Cosker helped Glamorgan towards only their second Clydesdale Bank 40 victory of the season with a three-wicket success over Sussex at Swansea.

The defeat is a setback to Sussex’s chances of reaching the competition semi-finals and was not the best way to warm up for the Friends Provident t20 against Nottinghamshire at Trent Bridge.

Sussex, who sank to their third defeat, were not helped by being without Matthew Prior (England duty) and injured duo Luke Wright and Yasir Arafat as they were restricted to 203 for seven in their 40 overs after winning the toss.

But in their chase Glamorgan, minus Mark Cosgrove, who dislocated a finger fielding, made something of a meal of their reply, not helped by some bad running between the wickets and poor shot selection.

In the end the home side squeezed to their target with only four balls to spare, helped to the winning line with a 60-run partnership between Mark Wallace and Ben Wright.

Sussex made a decent start but Nash lost fellow opener Ed Joyce, bowled through the gate by Will Owen, and Nash also saw Joe Gatting go to a sharp stumping by wicket-keeper Mark Wallace off Cosker. Nash’s 85 from 88 balls (his 50 came off 58 balls) was the backbone of Sussex’s innings and a useful effort in the context of the rest of the innings.

Sussex’s demise occurred during the batting powerplay when they lost four wickets for seven runs in only 13 balls.

They were going along well at 159 for two in the 31st over, with a 92-run partnership between Nash and Murray Goodwin, but suddenly slumped to 166 for six only two overs later. The main damage was done by Cosker, who claimed three of his four wickets in eight balls.

First he had Murray Goodwin caught at backward point reverse sweeping, and after Nash was caught in the deep off Owen, Cosker struck twice in three balls taking a return catch off Michael Yardy and then bowling Andrew Hodd – the slow left-armer’s 200th victim in one-day cricket.

In the end Sussex did well to get over the 200-mark, which was a lot fewer than they might have hoped for in mid-innings.

In reply Allenby, who reached 50 from 51 balls, gave Glamorgan more than a solid start in partnerships with opener Robert Croft and Will Bragg of 33 and 74 respectively.

During the Allenby-Bragg alliance slow left-armer Monty Panesar went for 31 from his opening three overs.

But Glamorgan’s good start was not helped by them subsiding from 107 for one to 141 for five, which put pressure on the lower order.

Wallace and Wright took Glamorgan towards victory but were both dismissed in consecutive overs, leaving Cosker to strike the winning runs from the second ball of the final over.