Trump started the day in fine fettle, responding to a break of 63 from Liang with one of 81 to claim the first frame. Though he was pegged back in the second, he soon moved 2-1 up.
However, Liang looked capable of causing an upset when he went 3-2 up, only for Trump to rattle off three straight frames - two with century breaks - to set up a meeting with Joe Perry in the last 16.
'What a finish, what a win' - Liang celebrates wildly after last-gasp win
Another player to put together an impressive run was Ding Junhui, who came back from 2-1 down to defeat Martin O'Donnell 5-2.
Ding got a break of at least 50 in every frame he won, including a highly impressive 121 in the sixth.
Judd Trump fights back from 63-0 down to take the frame
Elsewhere in the later session, Zhou Yuelong and David Gilbert both recorded crushing 5-0 wins over Fergal O'Brien and Anthony McGill respectively.
Sunny Akani and John Higgins were only made to work slightly harder with 5-1 wins over Elliot Slessor and Thepchaiya Un-Nooh downed Craig Steadman 5-2.
Stuart Bingham closed out the day's action with a 5-3 victory over Jimmy Robertson, recording centuries of 121 and a final-frame 120 in the process.
Selby closes out victory with break of 93
Jimmy White vs Judd Trump's Eurosport Masters shot of the championship pot
'No regrets' - Trump not disappointed with Masters loss to Hawkins