Warwickshire 325 and 344 for 9 (Barnard 101, Smith 62, Davies 50, Raine 4-89) beat Durham 387 and 276 for 8 dec (Raine 81, Booth 4-66) by one wicket
A sublime century from Ed Barnard and vital knocks from Kai Smith and Michael Booth led Warwickshire to a one-wicket win over Durham in a Rothesay County Championship thriller.
Warwickshire started well in the morning as Alex Davies looked in good touch for his 50, but his departure led to a mini-collapse before lunch, with the visitors losing four wickets for nine runs at the hands of Ben Raine and Matthew Potts.
However, Warwickshire had the perfect blend of experience and youth in the form of Smith and Barnard, who combined brilliantly for a partnership worth 147 to well and truly take the wind out of Durham's sails.
There was yet another twist though as the hosts bounced back after tea to remove the pair, with Brendan Doggett orchestrating the fightback to set up a grandstand finale and it all went down to the final pair, but Ethan Bamber and Vishwa Fernando remained calm and composed to see the visitors over the line as they reached their target of 339.
Resuming on 12 without loss, Davies and Rob Yates had a big task ahead of them and Davies started well as he hit Potts for back-to-back boundaries. However, at the other end Yates didn't last long as Raine bowled him for three, with the opener misjudging one that nipped back and as a result it sent his off stump flying.
Hamza Shaikh then survived a run-out appeal after there was confusion between the wickets for the England Under-19s man and Davies. The Bears skipper continued to look good with a pair of boundaries from a Raine over including a clever cut shot.
Davies then reached his half-century off 73 balls to give his side a good start in their pursuit of 339, but he then departed without adding to his score as the impressive Raine got him LBW.
Durham got their third as Potts got the key wicket of Sam Hain for just two, with the experienced right-hander edging behind to Ollie Robinson and he struck again next ball as Dan Mousley chipped one straight to Dan Hogg at mid-wicket. The England man couldn't get the hat-trick though as Barnard got it away for a single.
Durham continued to run through Warwickshire's top order, as Raine got his third with the last ball before lunch when Shaikh edged behind to Robinson to depart for 23.
The hosts nearly got their sixth when a diving Emilio Gay couldn't grasp one at silly mid-on when Barnard chipped a Raine delivery in the direction of the former Northamptonshire man.
First innings half-centurion Smith looked in good touch once again as he played a lovely cover drive to relieve some pressure. The Bears keeper and Barnard were solid in defence and took opportunities to score when they were on offer.
Smith and Barnard then took a liking to the bowling of Doggett, picking up three boundaries from one of the Australian's overs.
Barnard then passed 50 for the second time this season off 81 deliveries and Smith reached the milestone for the second time in the match just a few balls later.
The pair continued to take chunks out of the target and the hosts struggled to find answers, but they found one when Smith departed LBW to Raine for a well made 62 to add another twist to the game.
Durham had another run-out chance as Booth and Barnard had a mix-up in the middle but Will Rhodes' throw went to the wrong end as the latter was scampering at the other end.
Barnard's experience showed in the situation amid the chaos in the middle, the all-rounder rotated the strike well with Booth after the run out chance and reached his century from 133 balls, but he departed next ball with him edging a Doggett delivery to Robinson.
Doggett followed that up as he got Taz Ali caught behind for three and the hosts almost had their ninth when Bamber edged a Raine delivery between Robinson and slip fielder Ackermann.
A glorious straight drive from Booth for four released the shackles, but Potts bowled him for a valiant 40.
Fernando was the number 11 and Bamber tactically rotated the strike as Warwickshire got the target to single figures and Bamber got the visitors over the line with a six down the ground off the bowling of Raine.