Openers Chris Rogers and Sam Robson scored centuries as Middlesex fought back after following on against Surrey at Lord's.
The Australian openers shared a record stand of 259 on the third day of the Division One match as the hosts reached stumps with a lead of 111, with eight second innings wickets in hand.
Their partnership was Middlesex's highest opening stand against Surrey, beating the previous record of 232 by Pelham Warner and James Douglas at The Oval in 1907.
It was not the script Surrey skipper Graeme Smith would have had in mind at the start of the day, which Middlesex began on 161-9.
Their last pair added just five more before Zander de Bruyn pinned Corey Collymore in front, and Surrey - with a first innings lead of 179 - enforced the follow-on.
Middlesex's second innings could hardly have been more different, with skipper Rogers - who will be in Australia's Ashes squad - and Robson, who qualifies for England by residence next year, pummelling the Surrey attack.
Both players completed their centuries off 185 balls, Rogers having hit nine boundaries and Robson 14.
By the time Robson was caught behind hooking at a short ball from de Bruyn, they had turned Middlesex's 172-run deficit into a lead of 87.
Joe Denly was soon caught at second slip off Jade Dernbach but Rogers was still there at the close on 131no, off 240 balls with 10 fours.
His one moment of discomfort came on 96 when he was put on his backside by a Dernbach bouncer, but in the next over he stroked Tim Linley through the covers to complete his 59th first-class century.