Azhar Ali and Asad Shafiq both hit centuries to give Pakistan a first-innings lead before New Zealand's bowlers fought back in the deciding third Test in Abu Dhabi.
Pakistan began the third day three wickets down and still 135 runs in arrears but were only 50 behind at lunch, with Azhar having brought up his 15th Test hundred in the morning.
They had taken a lead by the time he was removed for 134 and, though Shafiq (104) reached three figures too, debutant Will Somerville led a New Zealand recovery as Pakistan went from 286-3 to 348 all out.
New Zealand then lost both of their openers in the 14 overs before stumps and finished on 26-2, with Pakistan 48 runs ahead.
Shaheen Afridi and Yasir Shah remove New Zealand openers Jeet Raval and Tom Latham before stumps in Abu Dhabi, the visitors trail Pakistan by 48 runs on 26/2 in their second innings.— ICC (@ICC) December 5, 2018
What was your highlight of day three?#PAKvNZ scorecard https://t.co/cS8PI6iRJl pic.twitter.com/UKD1rDJPo9
Pakistan encountered few difficulties in a morning session where they put on 85 runs and Azhar benefitted from no slip to reach his century with a loose shot.
His fourth-wicket alliance with Shafiq was worth 201 when Somerville claimed his first Test victim as Azhar's sweep was directed straight to Ajaz Patel at short fine leg.
Shafiq, who had narrowly avoided driving to gully on 73, had two further scary moments on 99 as a miscue fell short of midwicket and a big swipe hit his foot, but he eventually scampered through for a single to reach the landmark.
He had added just four more when he was trapped lbw by Patel as Pakistan lost their final six wickets for just 44 runs.
Babar Azam saw a delivery from Somerville come off his bat and hit both off his feet before rolling back onto the stumps, while Ross Taylor took a smart catch at slip off Patel's bowling to send Bilal Asif back.
Yasir Shah was run out at the non-strikers' end having stumbled and lost his shoe before Somerville, who finished with 4-75, accounted for Hasan Ali and Sarfraz Ahmed to restrict the Black Caps' lead to 74.
Pakistan made an early breakthrough in New Zealand's innings as Shaheen Afridi pinned the scoreless Jeet Raval in front in the fourth over.
And they were two down before the close of play as Tom Latham gave Yasir his 199th Test wicket with a top edge to Haris Sohail at deep square leg.
|Harris leads Australia into ascendancy on day one|
|ATP announces candidates to host future Finals|
|Ronaldo: Juventus fans refuse to lose to Torino|
|Hero Rivers feared he had cost Chargers in KC|
|Williams would welcome Llorente back to Athletic Bilbao|
|Liverpool v Manchester United: Minding the gap|
|Milan elimination unjust, fumes Leonardo|
|Paul hails ´sick´ Harden after record-breaking display|
|Liverpool v Manchester United: Salah, Mane and Firmino v Rashford, Martial and Lukaku in Opta number|
|Canelo open to GGG trilogy as he chases place in Mexican history|
|The big Friday Premier League quiz|
|Harden posts record fourth 50-point triple-double in win over Lakers|
|Barcelona squad happy with Dembele, says Alba|
|Chargers rally past Chiefs to clinch playoff spot|
|WATCH: Chargers top Chiefs on dramatic two-point conversion in final seconds|
|Suns owner Sarver committed to keeping team in Phoenix|
|Chargers WR Allen leaves with injury after near-spectacular catch|
|Socceroos not giving up on Mooy for Asian Cup|
|Cooper says Raiders owner wanted to trade him to Cowboys|
|Pochettino jokes Levy is ´worried´ about losing him|
|Barcelona would welcome Morata – Alba|
|Toure not a priority for West Ham – Pellegrini|
|Koscielny no certainty to face Southampton, says Emery|
|We gifted the game – AC Milan boss Gattuso furious after Europa League exit|
|My season starts now, says Koscielny|
|Cipriani ´at peace´ with latest England snub|
|Laporte: Deschamps must have personal reasons for France snub|
|Morata injury not too serious, claims Chelsea boss Sarri|
|Hansen to leave: All Blacks coach returning focus to World Cup defence|
|I want to fight the champion! - Joshua reiterates Wilder in April ambition|
|Gundogan glad to leave Christmas holidays behind|
|I know how it feels and it hurts - Gundogan on Sterling abuse|
|Celtic 1 Red Bull Salzburg 2: Scottish champions through despite defeat|
|Olympiacos 3 AC Milan 1: Rossoneri crash out of Europa League|
|Arsenal 1 Qarabag 0: Lacazette on target as Saka shines|
|Hansen to leave: All Blacks will take time to name replacement|
|Chelsea condemn alleged anti-Semitic chanting from fans|
|Hansen to leave: The best Opta facts from New Zealand coach´s tenure|
|Hansen to leave: Five contenders to be the next All Blacks coach|
|Hansen to leave: Highs and highs of his All Blacks reign|
|Hansen to leave All Blacks after World Cup|
|Rapid Vienna 1 Rangers 0: Late Ljubicic winner sends Gerrard´s men out|
|Beckham continues to miss Giants practice with quad injury|
|Vidi 2 Chelsea 2: Giroud spares Sarri´s side in lacklustre draw|
|Paris Saint-Germain and Marseille fixtures among latest Ligue 1 cancellations|
|Santos turn to ex-Argentina boss Sampaoli|
|Muller could miss Champions League last 16 after Tagliafico kick|
|Home hope Bekker out in front at Alfred Dunhill Championship|
|Van Bommel in touch with Robben over PSV reunion|
|Pinarello chief confident over Team Sky future|
|Stade make Ospreys tickets free in tribute to teenager|
|WRC great Loeb seals Hyundai switch|
|Madrid rumours better than sack talk, says Pochettino|
|Nadal to join Federer at 2019 Laver Cup|
|Prigoda smashes world record, Hosszu dethroned in Hangzhou|
|Former Juve CEO Marotta takes over at Inter|
|Glenn to stand down as FA boss next year|
|Muller apologises to Tagliafico for kick to the head|
|Pereira pleads for more Manchester United chances|
|Griffin hails ´phenomenal´ Lowry after Warriors demolition|
|I´ve played with Zidane and Henry, but Messi is something else – Pires|
|Dragons forward Jack de Belin charged with sexual assault|
|Durant: Raptors are the real deal|
|Cocu bids farewell to Fenerbahce after ´mutual agreement´ is made over October sacking|
|Australia unchanged for historic Perth Test|
|Champions League draw: The possible last-16 ties|
|Southee happy to be back on home soil|
|I wouldn´t swap Dembele for Neymar – Pires|
|Canelo ready to risk heavy weather against Fielding|
|Raptors upstage Warriors, Davis leads Pelicans with 44 points|