Middlesex had only themselves to blame after crashing to their first championship defeat of the season against a Derbyshire side playing with great spirit under the captaincy of Simon Katich, who has assumed extra responsibility after the departure of David Houghton, the coach.
It appeared straightforward enough when Middlesex began the day needing 219 to win with nine wickets in hand but Andrew Strauss, who had played so well the night before, was soon leg-before to Tom Lungley for 53 and Owais Shah scooped Graham Wagg to mid-off with a dreadful shot.
Ed Joyce and Ed Smith put on 78 for the fourth wicket but panic set in when Joyce was caught and bowled by Ant Botha and Smith was leg-before playing back to Greg Smith. Four more wickets fell in quick succession but the contest was not quite over.
Jamie Dalrymple made a cool, unbeaten 48 and Alan Richardson joined him in a last-wicket stand of 32 but Wagg settled the issue by bowling Richardson off an inside edge.