Ronnie O'Sullivan of England plays a shot in the final match against Shaun Murphy of England on day 7 of World Snooker Shanghai Masters 2019 at Regal International East Asia Hotel on September 15, 2019 in Shanghai, China.
Lei took the opening frame with an impressive break of 87 but runs of 84 and 101 saw O'Sullivan take a one-frame lead. However, Lei responded in style with a first-ever professional century to level the match before O'Sullivan once again replied taking frames five and six to progress after a couple of loose shots from his 16-year-old opponent.
Watch in full: 16-year-old Lei Peifan makes his first century as a pro…against Ronnie O’Sullivan
In the afternoon session world champion Judd Trump overcame Zhang Anda 4-1 to make round three.
Runs of 64 and 125 saw Trump open up a two-frame advantage but, Zhang, who cut the arrears with a 60 in frame three, was unable to capitalise when the world champion missed a routine red in frame four and breaks of 76 and 90 were enough for the Bristolian to set up a last-32 encounter with Jiahui Si.
Earlier, Matthew Stevens was unable to build on a strong start against Mark Selby, eventually going down 4-1 to the English Open winner.
Mark Selby dispatches sumptuous long red
Selby, a three-time world champion, produced breaks of 87 and 53 as he seeks to add the Alex Higgins trophy to his English Open title he secured back in October.
Elsewhere, Barry Hawkins held off Michael Holt, beating the Hitman 4-3 in tense affair at the Waterfront Hall in Belfast.
Hawkins, 40, produced runs of 64 and 119 to move past Holt to set up a fourth-round clash with Fergal O’Brien.
John Higgins produced breaks of 117 and 54 to open up a 2-0 lead against Kacper Filipiak, taking a cagey third frame for a 3-0 lead before the Polish 23-year-old hit back with a break of 78. But Higgins' class shone through in a tight fifth frame and he goes on to play Billy Joe Castle in the next round.
Shaun Murphy was also on top form against Luo Honghao, producing runs of 84, 122, 64 and 103 on his way to a convincing 4-1 win. Luo produced a fine break of 105 in the second frame to level the match, but Murphy was a cut above and faces Ricky Walden next.