Lancashire 174 (Buttler 77, Jennings 42) beat Yorkshire (Shafique 54, Anderson 3-25) by 21 runs
Jos Buttler posted a superb season's best 77 off 46 balls and became only the second Englishman to reach 13,000 career T20 runs as Lancashire Lightning beat Yorkshire in a pulsating Roses match at Headingley and qualified for the Vitality Blast quarter-finals.
With Nottinghamshire losing at Worcestershire, Lancashire would have advanced whatever this result. But ending a run of three Roses defeats, including one last week, means they secured a top-two finish in the North Group for a home tie in September's last eight.
Buttler's dynamism from No.3, including eight fours and three sixes, was the centrepiece of 174 all out, which saw the wickets shared around a Yorkshire attack on a competitive surface.
Leaders Lancashire won for the ninth time in 13 games - this by 21 runs - and already out Yorkshire lost their ninth game in 13.
Phil Salt drove this topsy-turvy contest's first two balls from Matt Milnes for four, but Dan Moriarty's left-arm spin had
Keaton Jennings caught at mid-wicket to keep the visitors in check at 23 for one after three overs.
Salt started and ended the powerplay positively, slog-sweeping Moriarty for six as 15 came from the sixth over, which ended with 58 on the board.
But Lancashire stumbled as Jafer Chohan's leg-spin had Salt caught at deep square-leg slog-sweeping for 42 with his first ball and bowled Ashton Turner two balls later - 65 for three in the eighth.
Buttler launched sixes in successive overs against spin over long-on. The first, against Dom Bess, took him beyond the 13,000 mark.
Alex Hales is the only other English batter to achieve the same feat, and they are amongst only seven batters worldwide to do so.
Buttler reached his third fifty in six Blast innings this season, this one off 26 balls. By that time, Lancashire were 121 for four after 13 overs having lost Luke Wells to Jordan Thompson's seam.
Despite Buttler's presence, Yorkshire took regular wickets to stymie progression.
Milnes struck twice and Will Sutherland once late on as the Red Rose fell short of the 200 or more total which has been king at Headingley this season.
There were two run outs, including Buttler, amongst three wickets to fall in Thompson's last over.
Wickets continued fall, though.
Luke Wood bowled Jonny Bairstow for five eight balls into Yorkshire's reply before Anderson had Will Luxton caught at deep midwicket - 24 for two in the third over.
Lancashire's quarter-final qualification was confirmed soon after, with Nottinghamshire's defeat.
Anderson removed Dawid Malan caught at mid-on before Green's bowled a reverse-sweeping James Wharton to tip the balance at 66 for four in the eighth over.
But, as wickets fell - Bess was caught behind off Wood soon after, Shafique was strong down the ground.
Shafique and Australian Sutherland put Yorkshire in a strong position at 132 for five in the 15th, needing 43 more.
However, Shafique pulled Anderson to deep square-leg and Thompson was caught and bowled off Green, turning the tide again at 137 for seven in the 16th.
Excellent Green trapped Milnes lbw and Tom Aspinwall removed Sutherland for 28 with successive balls at the end of the 18th over and the start of the 19th - 151 for nine.
Defending 22 off the last over, Blatherwick then had Chohan caught with the first ball.