The Rocket put together breaks of 84, 101, 95 and 54 to set up a third-round clash with Stuart Carrington who whitewashed Zhou Yuelong.
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.
NORTHERN IRELAND OPEN RESULTS
- Yuan Sijun 4 – 2 Joe O'Connor
- Ben Woollaston 4 – 2 David Lilley
- Stuart Carrington 4 – 0 Zhou Yuelong
- Graeme Dott 4 – 1 Craig Steadman
- Ronnie O'Sullivan 4 – 2 Lei Peifan
- Ricky Walden 4- 1 Sam Baird
- Mark Allen 4 – 0 Jamie O'Neill
- Mark Joyce 4 – 2 Jackson Page
- Stuart Bingham 4 – 1 Jordan Brown
- Kyren Wilson 4 - 1 Peter Ebdon
- Joe Perry 4 – 2 Ross Bulman (a)
- Judd Trump 4 – 1 Zhang Anda
- Stephen Maguire 4 – 2 Mark Davis
- Billy Joe Castle 4 – 3 Chen Feilong
- Scott Donaldson 4 – 3 Ian Burns
- Harvey Chandler 4 – 1 Mitchell Mann
- Mark Selby 4 - 1 Matthew Stevens
- Thepchaiya Un-Nooh 4 – 2 Mei Xiwen
- Allister Carter 4-3 Li Hang
- Ken Doherty 4 -0 Sohail Vahedi
- Luca Brecel 4 – 0 Matthew Selt
- Barry Hawkins 4 – 3 Michael Holt
- Alexander Ursenbacher 4 – 3 Martin O'Donnell
- Andrew Higginson 4 – 2 Rod Lawler
- Si Jiahui 4 – 1 Chen Zifan
- Anthony Hamilton 4 – 0 Jak Jones
- Tian Pengfei 4 – 2 Liang Wenbo
- Robbie Williams 4 – 1 Hammad Miah
- Yan Bingtao 4 – 1 Marco Fu
- Graeme Dott 4-1 Craig Steadman
- Jamie O'Neill 0-4 Mark Allen
- Lei Peifan 2-4 Ronnie O'Sullivan
- Ricky Walden 4-1 Sam Baird
- Joe O'Connor 2-4 Yuan Sijun
- Jimmy Robertson 3-4 Fergal O'Brien
- Ben Woollaston 4-2 David Lilley
- Stuart Carrington 4-0 Yuelong Zhou
- Kacper Filipiak 1-4 John Higgins
- Shaun Murphy 4-1 Luo Honghao