Brian Lara's ninth Test double hundred put West Indies in a strong position but Pakistan were closing on a draw in the second Test by the end of day four. Lara fell to leg-spinner Danish Kaneria (5-181) for 216 in the morning session as West Indies reached 591 for a first-innings lead of 234 in Multan.
Younis Khan (56) and Imran Farhat (70no) shared a century stand in reply.
And Mohammad Yousuf contributed 56 not out as the hosts went to stumps just 21 runs behind on 213-2.
During his innings, Lara surpassed legendary Australian Don Bradman's record of 18 scores of 150 and above and came within 96 of becoming the first man to score 12,000 Test runs.
The West Indies total was the highest they have ever scored in Pakistan, surpassing the 493 they racked up in Karachi in 1974.
606: DEBATE
It is now official, Brian Charles Lara is the best batsman of this generation SD
606: Have your say
Lara, 196 overnight, took a single and then drove Umar Gul through the covers for three runs to complete his double century off 241 balls, including 21 fours and seven sixes.
He hit another boundary off Gul before holing out at long-on, where Shoaib Malik took a straightforward catch.
Paceman Abdul Razzaq wrapped up the West Indian innings by dismissing Daren Powell and Taylor in the space of four deliveries.
Pakistan started shakily, and had just 24 on the board after an hour when Mohammad Hafeez played on to Jerome Taylor for 18.
But Younis played confidently to pass 4,000 career runs in 49 Tests. He is the 10th Pakistani batsmen to cross the milestone.
Younis was caught behind off spinner Dave Mohammed after stand worth exactly 100 from 149 balls with Farhat.
Farhat, dropped in the next over on 45 by Shivnarine Chanderpaul at short mid-off, then combined with the in-form Yousuf to put on an unbroken 89 for the third wicket.
Afterwards Pakistan captain Inzamam-ul-Haq said he believed Pakistan could get something out of the Test.
"We still have to bat sensibly because we are still behind them," he said.
"I thought we came back strongly today taking Lara's wicket quickly which was crucial and our batting reply was strong."