When Maxwell came to the crease, Yorkshire were 169-5 having just lost Jack Leaning, and the outcome of the game was back in the balance.

But the man nicknamed ‘The Big Show’ played to his natural attacking strengths, scoring three fours to go with the six that settled proceedings in a 27-ball stay.

That Maxwell was able to apply the coup de grace to a win that left Yorkshire with the only unbeaten record in the division was down to some equally significant contributions from his team-mates.

Adam Lyth top-scored with 67, made from 131 balls with 11 fours, the left-hander maintaining the good form that had seen him score his maiden Test hundred at Headingley 10 days earlier.

Andrew Gale, who has struggled in the Championship of late, played a captain’s hand of 37, surviving for over an hour and a half as Middlesex probed away in anything but straightforward batting conditions.

Gary Ballance chipped in with 29, Leaning with a handy 25, and Will Rhodes with a resilient 10 not out, the young all-rounder adding an unbeaten 26 with Maxwell at the climax.

Earlier, Rhodes played a key role with the ball to help keep the chase to a manageable level. He captured the last three wickets as Middlesex lost 4-23 at the end of their second innings, a mini-collapse that ultimately cost them dear.

Rhodes had Harris lbw, Toby Roland-Jones brilliantly held by Ballance diving to his left in the covers, and then bowled Tim Murtagh.

After being drafted in as a late replacement for Ryan Sidebottom (calf), Rhodes stepped up at significant times.

Middlesex were arguably slightly ahead at the start of the day, resuming on 127-4, a lead of 110, but it was really too close to call.

Yorkshire were in need of breakthroughs, however, and one arrived from the sixth ball of the morning when Lyth had Dawid Malan caught at slip by Tim Bresnan, ending a stand of 58 with James Franklin in a move that repaid Gale’s bold decision to start with his part-time spinner.

When John Simpson played on to Bresnan, Middlesex were 159-6 and the lead was just 142.

But Franklin and Ollie Rayner frustrated Yorkshire in a seventh-wicket stand that realised 47 in 16 overs, one that should have inspired a lead of 250-plus.

It needed the introduction of Steve Patterson to break the partnership, which triggered that mini-collapse at the end, the pace bowler having Rayner caught at short cover by Ballance.

As usual, Patterson blocked things up as expertly as a line of police cars across a motorway junction. He conceded only 33 runs in his 23 overs, Franklin – who finished unbeaten on 55 in an innings that lasted over three hours – drying up against him as surely as a stand-up comedian who has run out of jokes.

Yorkshire’s chase started straight after lunch, openers Lyth and Alex Lees accumulating sensibly and showing good awareness of the location of their off stump. But after lasting 56 minutes, Lees fell with the total on 27 in the 15th over, lbw to Franklin’s first ball.

Lyth and Ballance took Yorkshire to tea on 91-1, with both players strong through the cover region. But Ballance went shortly after the break, comprehensively stumped by Simpson after walking down the wicket to Rayner’s off-spin.

Lyth reached fifty from 108 balls with nine fours but was third out with the score on 129, caught behind off Rayner.

When first innings centurion Jonny Bairstow – three balls after being badly dropped by Franklin at first slip off Roland-Jones – was held by Rayner at second slip off the same bowler, Yorkshire were 132-4 and the visitors were back in the hunt.

It required a stunning catch in the same second slip position by Rayner to remove Leaning off Harris, before Gale was bowled advancing at Murtagh.

But Maxwell and Rhodes saw their side home in what had the feel of an important win.