In a race between two teams and the setting sun, the nature triumphed in the end as Pakistan held on to draw the second Test Friday against New Zealand in Karachi, with the two-match series ending 0-0.

Sarfaraz Ahmed hit a fighting century that took the match deep with multiple results possible.

A series-deciding defeat was on the cards at lunch with the total on 125-5, but Sarfaraz and Shakeel carried the fight to the New Zealand bowlers with a sixth-wicket stand.

In the end, New Zealand were left needing a wicket while Pakistan were 15 runs away when bad light ended the match with three overs still to spare.

Pakistan’s last pair Naseem Shah and Abrar Ahmed survived 21 balls in fading light, but also connecting with a few hits to keep alive their hopes of an unlikely win.

New Zealand were in sight of a series-clinching victory after dismissing Sarfaraz for a career-best 118.

But as dusk settled, Naseem scored 15 and Ahmed seven to guide Pakistan to 304-9 in pursuit of a 319-run target when umpires Alex Wharf and Aleem Dar declared the light unfeasible to continue with three overs remaining.

The two-match series ended 0-0 after the first Test – also in Karachi – ended in a draw, depriving New Zealand of their first series win in Pakistan for 53 years.

New Zealand took the second new ball and with the fourth delivery Tim Southee dismissed Agha Salman for 30 to break a 70-run stand for the seventh wicket before Bracewell dismissed Sarfaraz to raise hopes of a win.

But it was Sarfaraz whose fourth Test century – first in eight years – which set Pakistan on course for a fighting draw.

Pakistan were staring at defeat at lunch but Sarfaraz led the fight back during a sixth wicket stand of 123 in three hours with Shakeel who made 32.

Pakistan reached 179-5 at tea, needing a further 140 runs in the 31 overs – a point from where Sarfaraz sped up the run rate by smashing three boundaries and a six off spinner Michael Bracewell before driving pacer Matt Henry for two to reach his hundred.

But once Pakistan lost Sarfaraz, Hasan Ali (five) and Salman in the space of 14 runs, NZ went for the kill.

The previous best winning chase in a Test in Pakistan was 314 by the home team against Australia in Karachi in 1994.

Sacked as captain of all three formats in October 2019, Sarfaraz staged a comeback in the drawn first Test – also in his hometown of Karachi – and top scored the series with 335 runs with three fifties and a hundred.

In all, Sarfaraz batted for four hours and 48 minutes, hitting nine boundaries and a six – an improvement on his previous highest of 112 made against the same opponents in Dubai eight years ago.

Spinner Michael Bracewell (4-75) and Ish Sodhi (2-59) jolted Pakistan earlier with three wickets in the first session.

Resuming two down without any runs on the board, Pakistan lost Imam-ul-Haq (12), skipper Babar Azam (27) and Shan Masood (35) before reaching three figures.

Haq fell to a rash drive off Sodhi as the ball spun in and crashed onto the stumps.

Azam and Masood then put on 42 runs and were looking solid when Bracewell came into the act.

He first removed Azam with a sharp turning delivery that was edged to wicketkeeper Tom Latham, while Masood miscued a lofted shot and was caught by Kane Williamson at mid-off.

Here are some reactions to the thrilling finish in Karachi:

With AFP inputs

Scores: New Zealand 1st innings 449 and 277-5 (T. Blundell 74, T. Bracewell 74). Pakistan 408 and 305-9 (Sarfaraz 118; Bracewell 4-75).