Pakistan were just two wickets away from a win and taking a 1-0 lead in the three-match series after England’s tail wagged on the fifth and final day in Dubai on Monday.
Leg-spinner Yasir Shah took 3-82 and left-arm spinner Zulfiqar Babar took 2-51 as England, set a daunting 491-run target, were 285-8 at tea on the fifth afternoon at Dubai stadium.
England put up a good fight with Joe Root (71) and Stuart Broad (30) showing resistance before Adil Rashid remained not out on 47 at the break.
Mark Wood was the other unbeaten batsman on 17 but England still need 206 runs for an unlikely win or to bat out the final session to draw the game.
The first Test ended in a draw. The third and final Test starts in Sharjah on November 1.
Pakistan had sensed victory at lunch with just three wickets to take but Rashid and Broad frustrated them through their 60-run stand for the eighth wicket.
It was Riaz who bowled Broad to bring Pakistan two wickets closer to the win but Rashid and Wood further delayed the verdict batting for 9.3 overs for their 32-run stand.
England’s hopes of a fightback were pinned on Root, who resumed cautiously on 59 as Pakistan attacked through Babar and Riaz.
Root completed 3,000 Test runs when he reached 61 with a single off Riaz towards square-leg. He completed the milestone in his 34th Test and became the 41st English batsman to score 3,000 or more runs in Test cricket.
But Babar did not take long to dismiss Root with a sharp turner which took the edge of his bat towards the slips, where Younis Khan took a low catch.
Root hit six boundaries off 171 balls.
Jonny Bairstow, dropped on 11 off Babar, did not survive much longer as Shah bowled him through the gate with a sharp googly for 22 as England slumped to 163 for five.
Jos Buttler survived for 26 deliveries before Shah had him caught by Younis in the slips for seven as England went to lunch on 187-6.