Derbyshire 162 for 3 (Madsen 69, Godleman 57) beat Lancashire 151 for 9 (Livingstone 58, Rampaul 3-19) by 11 runs
Derbyshire secured a Vitality Blast quarter-final berth with an impressive and pulsating 11-run win over North Group leaders Lancashire at Emirates Old Trafford.
The Lightning lost for only the second time in 13 games and will have to wait until later in the week to secure top spot in the group as they failed to chase 163 and 16 off the last over from ex-West Indies quick Ravi Rampaul. Derbyshire won their seventh game in 14 to jump to second place, but they can't secure a home tie in the last eight.
Liam Livingstone's 58 off 36 balls was the feature of Lancashire's 151 for 9 in front of 14,752 crowd - a non-Roses Blast record at Old Trafford.
Wayne Madsen top-scored with a superb 69 off 39 balls, while captain Billy Godleman ably supported him with 57 off 50 as Derbyshire posted 162 for 3. The second-wicket pair shared 112 inside 13 overs to advance from 17 for 1 in the fourth having elected to bat.
Derbyshire's total could have been even higher. Godleman and Madsen were excellent, the latter in particular as he mixed power with invention and hit six fours and three leg-side sixes.
Godleman, meanwhile, moved to the 940-run mark in both forms of limited-overs cricket this season. No one else in county cricket has been as prolific.
Madsen reached 50 off 27 balls before Godleman followed him to the same milestone off 45 balls. With those two together, Derbyshire were ideally placed at 96 for 1 after 12 overs. But they only scored a further 66 runs from the last eight. Three of the last eight overs were, however, bowled by the miserly Australian left-arm seamer James Faulkner.
Glenn Maxwell and fellow offie Steven Croft both claimed cheap wickets. Croft took the new ball and returned 1 for 13, while expensive legspinner Matthew Parkinson also struck.
Derbyshire's defence then got off to the ideal start when Alex Davies pulled new-ball quick Logan van Beek to square for a two-ball duck, the first of three wickets in the Powerplay.
Rampaul had Croft caught at deep midwicket and bowled Josh Bohannon with successive deliveries in the fourth over, leaving the score at 33 for 3. But Livingstone was proving a danger. He hit two leg-side sixes off Fynn Hudson-Prentice on the way to a six-over score of 52 for 3.
With Keaton Jennings also at the crease, the Lightning then reached halfway at 77 for 3, needing 86 more.
When Livingstone reached 50 off 33 balls in the 13th over, Lancashire had moved to 90 for 3. But he fell caught behind off medium-pacer Alex Hughes later in the over with nine more added to the total, ending a partnership of 66 with Jennings.
Two balls later, legspinner Matt Critchley had Jennings caught at short third-man reverse sweeping before, in the 15th over, big-hitting Aussie Maxwell was bowled by ex-Red Rose seamer Luis Reece as the score fell to 108 for 6 - a key scalp.
Dane Vilas and Faulkner took the target down to 29 off the last three overs, but Vilas was run out at the start of the 18th over.
Seamer Hudson-Prentice, with 29 off two needed, then conceded a six to Faulkner before getting him caught at long-on next ball to leave Rampaul defending 16 off the last with debutant Liam Hurt on strike. Rampaul bowled him with the game's last ball.