Ronnie O'Sullivan came close to a shock first-round loss at the Dafabet Masters at Alexandra Palace in London before beating China's Liang Wenbo 6-5.
Defending champion O'Sullivan was 5-4 down as the Chinese cueman won three straight frames to overturn a 4-2 deficit.
And the best-of-11 contest reached the decisive frame, when O'Sullivan recorded his best break, of 121.
The 41-year-old Englishman, a five-time world champion, is seeking a record seventh Masters title.
O'Sullivan will play either Neil Robertson or Ali Carter in the quarter-finals.
The tournament finishes next Sunday.