LV=County Championship Division One, Edgbaston (day four):
Northamptonshire 250: Hannon-Dalby 7-46 & 72-0 dec
Warwickshire 147-4 dec & 176-8: Burgess 78*, Barnard 41, Sanderson 5-42
Warwickshire (19 pts) beat Northants (2 pts) by two wickets
Northamptonshire are on the brink of relegation back to Division Two of the County Championship after bravely losing by just two wickets to Warwickshire in a breathless thriller at Edgbaston.
With two games left, against the Division One top two of Surrey and Essex, Northants are now 32 points adrift of safety.
In a contrived declaration, Northants looked like they might snatch a famous victory when they set the Bears just 176 to win off 60 overs.
Visiting paceman Ben Sanderson steamed in to take a hat-trick, claiming four of the wickets as the hosts were reduced to 24-5.
But, first in a 70-run partnership with Ed Barnard (41), then in an unbroken 52-run stand with Oliver Hannon-Dalby (9 off 42 balls), Michael Burgess just about kept his head to hit a match-winning 78 not out.
He was dropped twice, by Hassan Azad at third slip, then again when just seven runs were still needed, after Jack White spilled a caught and bowled chance, a tough skier coming over his own shoulder.
But Burgess survived and struck a six to complete the Bears' fourth red-ball win of the season and dispel their own slight relegation fears.
After a whole lost day on Tuesday, Northants needed some sort of deal between the two captains to engineer any chance of a result - and ex-Lancashire player Luke Procter found a willing accomplice in his opposite number, former Yorkshire all-rounder Will Rhodes.
First, the Northants spinners raced through 11 overs in just 20 minutes to clear up their -5 over rate. Then the Bears declared on 147-4, still 97 runs behind.
Northants batted for just an hour and a half, as openers Emilio Gay and Azad sharied an unbroken stand of 72 in 22.3 overs before they declared 10 minutes prior to lunch.
That left a clearly pre-arranged Bears target of 176 in a minimum of 60 overs - which was quickly transformed from its apparent molehill into a mountain.
White clipped Kraigg Brathwaite's off-stump before Sanderson then delivered a masterclass of an over, to trigger the first hat-trick of his career.
He had Rhodes caught at first slip, bowled Sam Hain's off stump and Dan Mousley then edged to third slip.
When Rob Yates edged an attempted drive off Sanderson to first slip, the Bears were in big trouble but Barnard and Burgess restored a bit of order.
Barnard tried sweeping Rob Keogh in the last over before tea and was lbw before Danny Briggs hit five fours in a quickfire 24 to see the hosts closer.
Sanderson (5-42) returned to trap Briggs before Craig Miles top-edged to leave the Bears back in serious bother on 124-8.
But the redoubtable Hannon-Dalby has shown before that he is the man for a crisis - and, clearly still on a high from his career-best 7-46 two days earlier, he kept Burgess admirable company although not before that final late heart-stopping miss.
Warwickshire first-team coach Mark Robinson:
"We didn't want to chase more than that because we knew from the three days we have played the ball has gone past the bat a lot. They have got an excellent opening bowling partnership so we knew it wouldn't be easy.
"From 24-5 you don't win many games so it was an excellent comeback. Burgey and Barney batted really well and then suddenly we were eight down.
"But Burgey is still there batting beautifully and Olly comes in with his great character and great heart. He takes his batting so seriously and stuck in there while we got over the line.
"I feel for Northamptonshire who are like us this time last year, giving it everything to try to stay up. They showed a lot of heart and bowled really well, especially Sanderson and White. But, for us, it is a big win and an important win. After what happened in the [One-Day Cup] semi-final and then at The Oval last week."
Northamptonshire coach Jon Sadler:
"It was a tough one this morning, negotiating. They wanted a lot less and we wanted a lot more in that run chase. But we didn't have any cards to play, our over rate was down and time was of the essence so we had to take it.
"The first session of the day was not what anybody wants to see at this level, we know that, but the game made up for it in the second and third sessions.
"I'm really proud of our lads. They fought and fought and fought and Ben bowled magnificently. He is like a magician - when he bowls like that there's nobody better.
"We were behind the eight-ball and the odds were against us but all of a sudden we made them panic and put them under some serious pressure. A great game for the neutral, but ultimately we felt like we could have won, which is why the players are devastated."