Swashbuckling opener Rahmanullah Gurbaz hit a career-best 151 to lead Afghanistan to 300-5 against Pakistan in the second one-day international in Hambantota on Thursday.
The 21-year-old scored an aggressive run-a-ball century and shared an opening stand of 227 with Ibrahim Zadran, who scored a 101-ball 80, after Afghanistan won the toss and batted.
Afghanistan need a win to level the three-match series after losing the first match by 142 runs, and Gurbaz knocked 14 boundaries and three sixes against a world-class attack that had reduced them to 59 all out on Tuesday.
Gurbaz's previous best was 145 against Bangladesh in Chattogram last month.
Zadran also hit out brilliantly, knocking six boundaries and two sixes.
Spinner Usama Mir broke the opening stand in the 40th over when he had Zadran caught at long off, while lanky pacer Shaheen Shah Afridi dismissed Gurbaz caught behind in the 45th over.
Shaheen also had Rashid Khan out for two to finish with 2-58.
Mohammad Nabi made a run-a-ball 29 before he was caught off Naseem Shah as Afghanistan piled up 73 runs in the last ten overs.
Fast bowler Haris Rauf, who picked up a career-best 5-18 in the first match, went for 48 in seven overs without success.
PAKISTAN: Babar Azam (captain), Shadab Khan, Mohammad Rizwan, Fakhar Zaman, Imam-ul-Haq, Agha Salman, Iftikhar Ahmed, Usama Mir, Haris Rauf, Naseem Shah, Shaheen Shah Afridi
AFGHANISTAN: Hashmatullah Shahidi (captain), Rahmanullah Gurbaz, Ikram Alikhil, Ibrahim Zadran, Riaz Hassan, Mohammad Nabi, Shahidullah Kamal, Rashid Khan, Mujeeb Ur Rahman, Fazal Haq Farooqi, Abdul Rahman