Leg-spinner Adil Rashid took a five wicket haul to trigger a Pakistan collapse, but England fell 25 runs short of a dramatic win in the first Test in Abu Dhabi.
Rashid, who had the worst bowling figures on his debut in the first innings of 0-163, had an unbelievable change in his fortunes as he grabbed 5-64 to dismiss Pakistan for 173 on a weary fifth-day Sheik Zayed Stadium pitch.
England tried hard to chase down the 99-run target in a possible 19 overs, but umpires called off play eight overs early due to bad light with the visitors on 74-4.
Joe Root finished with 33 in the fading light as Pakistan attacked with spinner Zulfiqar Babar (2-27) and Shoaib Malik (2-25) to keep the slate clean in the three-match series.
A result had looked highly unlikely on the fifth morning as England, replying to Pakistan's 523-8 declared, closed their first innings at 598-9.
But Pakistan's notoriously fickle batting changed the complexion as Rashid exploited the rough with seven wickets falling for 71 runs, the last five for only 14 in the post tea session.
Only skipper Misbah-ul-Haq put up some resistance with 51 on a day when 15 wickets fell, compared to 16 over the first four days.
England went after the target with Jos Butler joining Moeen Ali as opener but Pakistan checked them with some accurate bowling.
England lost Butler (4), Ali (11), Ben Stokes (two) and Jonny Bairstow (15) in the 11 overs.
It was a lucky escape for Pakistan as there have been 14 previous instances when teams had lost a Test after scoring 500 points or more.
Despite a slow and flat pitch, both teams will regret missed opportunities which allowed Malik (caught off a no-ball on 40) to hit 245 in his comeback match and Cook scored 263 (dropped on 147 and 173).
The three-match series will resume in Dubai from October 22 with the final Test in Sharjah from November 1.
Pakistan had hoped Younis Khan (45) and Misbah would handle the situation at 47-3 after opener Mohammad Hafeez was run out for 34, failing to beat an excellent throw by Stokes
from the covers while taking a sharp single.
But soon after tea, Younis tried to play a big shot off Adil to be caught in the covers while Misbah jumped out to heave Ali (2-28) and was bowled.
The Pakistan skipper hit six boundaries in his 30th Test half century.
Rashid then came into his own, dismissing Zulfiqar Babar (one), Sarfraz Ahmed (27) and Imran Khan in successive overs.
Cook was happy with his team's effort.
"We would have liked another three or four overs," said Cook, who was named as man-of-the-match. "But that's the way it is. I can't fault the guys, on a really flat wicket, conceding 500, we had to hang in there. We're proud."
Misbah admitted his batsmen let Pakistan down.
"I think wrong shots especially from Younis and me that put us in a tough position but in the end its a big advantage that the series is still 0-0," said Misbah.