Neil Dexter's unbeaten 77 helped guide Middlesex to 280-7 after a hard-fought first day against Surrey at the Kia Oval.
Dexter's innings allowed Middlesex to shade the opening exchanges despite the best efforts of Gary Keedy, Surrey's 38-year-old left-arm spinner, who took 3-61 from 25 overs.
But Dawid Malan and Chris Rogers also hit half-centuries for fourth-placed Middlesex, who after last week's shock home defeat to Somerset must win their last three matches if they are to have any chance of taking the championship title.
Early strikes with the new ball by Jade Dernbach and Tim Linley gave Surrey the start they craved, after Middlesex had won the toss and decided to bat, but then Rogers, Malan and Dexter each threatened to take control before being pegged back by some determined bowling and fielding.
Keedy's three-wicket spell after tea then stifled Middlesex's progress until Dexter, joined by James Harris to see out the last 45 minutes, held firm.
At stumps Dexter had batted for 210 balls, hitting seven fours in almost four hours at the crease. Harris remained 11 not out, from 44 balls.
The match began with Rogers easing the first ball, from Dernbach, through the covers for four but the bowler then struck in his second over to have Sam Robson caught behind for a duck.
Joe Denly made it to 12 before edging a defensive push at a good one from Linley to third slip, where Vikram Solanki took a low tumbling catch to his right, but Rogers and Malan would flourish in a third wicket partnership of 93.
The stand ended in the first over after lunch when Rogers, having reached 55 from 89 balls with eleven fours, was called for a single by Malan, who had driven Gareth Batty's off spin just wide of mid off.
Dernbach did well to move quickly to his left, pick up and throw past Rogers for keeper Davies to run him out at the striker's end.
Keedy, brought on for the 41st over with the score at 155-3, immediately found some turn but was made to wait until the first over after tea for his initial success.
By then, Malan's fluent innings of 61 from 99 balls, with 10 fours, had been cut short by Linley who angled one across the left-hander to have him caught at second slip by Zander de Bruyn.
Linley had also had Malan dropped by Batty at first slip on 59, but now it was Keedy who began to get among the Middlesex lower-middle order, until Dexter and Harris stopped the rot.
John Simpson, on 23, mishit a sweep to square leg, where Arun Harinath took the catch, Gareth Berg thin-edged to Davies on 19 and Ollie Rayner, also playing defensively, was beaten on four by Keedy's spin away from the right-hander and edged to De Bruyn at slip.