Teenager Naseem Shah became the youngest fast bowler to take a five-wicket haul in test cricket history as Pakistan completed a winning comeback on home soil with a 1-0 series victory over Sri Lanka on Monday.

The 16-year-old Naseem took two of the last three wickets to fall in the final day's 15 minutes of play to end with 5-31 from 12.5 overs as Pakistan sealed a comprehensive 263-run win to complete the two-test series, the first in Pakistan in a decade.

At 16 years, 311 days, Naseem very nearly beat the all-time mark for the youngest player to claim a five-wicket haul. Fellow Pakistani Nasim-ul-Ghani, a left-arm spinner, was 16 years, 303 days when he claimed the honour against the West Indies in 1958.

Pakistani bowler Naseem Shah plays against Sri Lanka during the Test in Karachi, Pakistan, Monday, Dec. 23, 2019. Teenager Shah became the youngest fast bowler to take a five-wicket haul in test cricket history as Pakistan completed a winning comeback to tests on home soil with a 1-0 series victory over Sri Lanka on Monday. (AP PhotoFareed Khan)

Pakistani bowler Naseem Shah plays against Sri Lanka during the Test in Karachi, Pakistan, Monday, Dec. 23, 2019. Teenager Shah became the youngest fast bowler to take a five-wicket haul in test cricket history as Pakistan completed a winning comeback to tests on home soil with a 1-0 series victory over Sri Lanka on Monday. (AP PhotoFareed Khan)

Naseem's effort punctuated a welcome winning return for the home side. Following the terrorist attack in 2009 on the Sri Lanka team bus in Lahore, Pakistan was deemed too unsafe by international cricket authorities. The team played its 33 home tests offshore, primarily in the United Arab Emirates.

The fifth day of the second and last test resumed with Sri Lanka reeling at 212-7, chasing a daunting victory target of 476. Sri Lanka didn't add any runs and it took less than three full overs for Pakistan to wrap up the visitors.

Having dismissed Dilruwan Perera with the last ball bowled on Sunday, Naseem removed Lasith Embuldeniya for a duck with Monday's first ball, the tailender gloving a sharp rising delivery to the wicketkeeper.

Players of Pakistan cricket team celebrate their victory against Sri Lanka in the second test in Karachi, Pakistan, Monday, Dec. 23, 2019. Pakistan completed a winning comeback to tests on home soil with a 1-0 series victory over Sri Lanka on Monday. (AP PhotoFareed Khan)

Players of Pakistan cricket team celebrate their victory against Sri Lanka in the second test in Karachi, Pakistan, Monday, Dec. 23, 2019. Pakistan completed a winning comeback to tests on home soil with a 1-0 series victory over Sri Lanka on Monday. (AP PhotoFareed Khan)

While Naseem missed his hat trick, century-maker Oshada Fernando fell in the next over, nicking a catch to first slip off legspinner Yasir Shah without having added to his overnight score of 102.

Naseem, playing in only his third test, trapped Vishwa Fernando lbw for a duck in the following over to wrap up the match.

“We definitely needed that performance," said Pakistan's Azhar Ali, celebrating his first test win as captain.

Pakistani captain Azhar Ali holds a trophy to celebrate the victory against Sri Lanka in the second test in Karachi, Pakistan, Monday, Dec. 23, 2019. Pakistan completed a winning comeback to tests on home soil with a 1-0 series victory over Sri Lanka on Monday. (AP PhotoFareed Khan)

Pakistani captain Azhar Ali holds a trophy to celebrate the victory against Sri Lanka in the second test in Karachi, Pakistan, Monday, Dec. 23, 2019. Pakistan completed a winning comeback to tests on home soil with a 1-0 series victory over Sri Lanka on Monday. (AP PhotoFareed Khan)

"Special thanks to Sri Lanka from the bottom of our hearts. They have given us immense happiness by playing in Pakistan.

"It’s a big advantage to be playing at home and now we can take the confidence from our performances overseas.

“It had been a tough year in test cricket for us but it was an emotional moment returning home to play. So much talent in these youngsters, experience will come with time. They are the best bowlers in Pakistan and we should back them.”

After the drawn first test in Rawalpindi, Pakistan won the toss but fell cheaply in the first innings for 191, after which Sri Lanka took an 80-run, first-innings lead.

Pakistan returned with a phenomenal second innings of 555-3, with all of its top four batsmen making centuries, setting Sri Lanka a virtually impossible target.

“This is of course a very emotional and happy moment for us,” Pakistan pace great and bowling coach Waqar Younis said.

“UAE has been our home away from home, but home is home after all. Playing in front of your home people is always something special. Its heartening to see how people turned up to cheer us.

"They have shown their love for cricket and shown the world that this is a safe place and lets play more cricket here.”

More AP sports: https://apnews.com/Cricket and https://twitter.com/AP_Sports