Lancashire were staring defeat in the face on the fourth and final day of their County Championship clash with Nottinghamshire at Trent Bridge
Needing the unlikely target of 349 to win, Lancashire were 99 for five at lunch.
Lancashire had been seven for one over night and in the morning session they lost Paul Horton, Simon Kerrigan, Andre Agathagelou and Luke Procter in the Wednesday morning session.
On Tuesday Lancashire medium-pacer Tom Smith finished with five for 53 as the hosts collapsed from 188 for three to 220 all out in their second innings.
But thanks to 90 from Riki Wessels, Nottinghamshire were still able to set Lancashire 349 to win - 342 of which were needed on the final day, after the Red Rose crawled to seven for the loss of Luis Reece at stumps.
Lancashire resumed their first innings after a short delay because of a shower on the third morning, and were able to stave off the threat of the follow-on.
From 77 for six, they were helped when Kabir Ali was dropped at slip by Wessels and was therefore able to stick around for 56 balls and allow Smith time to make an unbeaten 42.
Eventually, however, Luke Fletcher (three for 15) returned and - with his first two deliveries of the day - the tall seamer ended the Lancashire innings, Simon Kerrigan caught-behind down the leg-side and then James Anderson also edging to the wicketkeeper.
When the hosts batted again, Anderson put down a tough low chance at slip off Smith to give former Lancashire all-rounder Steven Mullaney an early reprieve.
But Kabir (three for 29) bowled Mullaney through the gate on the defence to break an opening stand of 56 and then had both Phil Jaques and Samit Patel caught by young wicketkeeper Alex Davies.
Patel, unable to add at all to his first-innings 93, appeared astonished to be given out.
Wessels and Michael Lumb responded with a century stand for the fourth wicket. But Smith then had Lumb caught-behind and nipped one back to bowl Alex Hales, who went playing no shot for a duck in the same over.
Although Kabir then returned Wessels’ earlier favour, dropping him at mid on off Anderson, the batsman could add only five more before the England seamer yorked him.
That opened the floodgates, and Smith was on a hat-trick at one stage as Nottinghamshire lost their last seven wickets for 30 runs.