Ronnie O’Sullivan rallied from the brink of defeat to beat Ding Junhui in a final-frame decider and keep alive his hopes of an eighth Masters title.

O’Sullivan looked to be heading out of the tournament when he trailed 5-3 with Ding on a break of 28, but a simple missed red to the middle cost the Chinese player dear.

The world champion won the frame and hauled back level before he was gifted a 6-5 victory after a rash attempt at a long brown by Ding, who won his only Masters title in 2011.

O’Sullivan said: “It’s a big match and it’s not always going to go your way, so you’ve just got to suck it up sometimes.

“I never doubt my ability to stick in there and my match-player temperament and bottle-wise I know I’m Premier League in that department.”

Ding had blazed through the first three frames to establish a commanding lead but a 103 from O’Sullivan gave him hope of pulling back into the match.

2019 Dafabet Masters – Day Seven – Alexandra Palace
Ronnie O’Sullivan is a seven-times Masters champion (Steven Paston/PA)

A brilliant 60, almost entirely comprised of low-value colours, further narrowed O’Sullivan’s deficit but sparked a superb response from Ding who fired a 129 clearance.

In what was developing into a classic Masters contest, O’Sullivan responded with a break of 100 to go 4-3, only for Ding to immediately hit back with 128 to go within one frame of victory.

O’Sullivan gave Ding hope in the decider when he missed a red to the middle on 34, but Ding’s bizarre choice to take a long brown proved to be his final shot of the match as a 73 from O’Sullivan sealed his place in the last eight.

Dafabet Masters 2016 – Day Eight – Alexandra Palace
No other player can match Ronnie O’Sullivan’s seven Masters titles (Adam Davy/PA)

Afterwards, O’Sullivan gave a glimpse into the lockdown routine which is contributing one of the most successful periods of his career.

“I’ve been spending six hours a day on the practice table religious for weeks, because I have not much else to do really,” added O’Sullivan.

“I’m probably the fittest I’ve been for 10 years. I’m running 45 miles a week at the moment and I’m more excited about that than anything else.”

John Higgins held his nerve to beat Mark Allen 6-5 and book a quarter-final date with O’Sullivan.

Higgins trailed 39-3 in the final frame before a superbly crafted break of 59 saw him into the last eight.

The Scot had led 3-1 with Allen’s only first-session success a second-frame break of 106 – the 600th century in Masters history.

Allen started the second session with a 92 break and levelled matters by capitalising on some uncharacteristic Higgins errors to win the sixth frame on the black.

Higgins quickly regained his composure with breaks of 84 and 80, but Allen fought back to make it 5-5 and set up a thrilling final frame.