The opener joins just a handful of cricketers who have managed this feat.
The 32-year-old scored a hundred against Sri Lanka in their second match in Karachi on Saturday.
Before that, he scored 109 in his debut Test in Rawalpindi, but that match ended in a draw.
Earlier this year, he scored 112 in his first ODI in Dubai against Australia, to become the first batsman to score a century on his Test and ODI debut.