His Test career opened with a half-century in each innings against New Zealand at Dunedin in 2008. A year later at Kingstown his maiden Test hundred, against the West Indies, helped Bangladesh to their first Test win away from home. He also made 151 against India at Dhaka. On a tour of England he became the first Bangladeshi to reach three figures at Lord's, earning a spot on the honours board, and he added another hundred at Old Trafford; Wisden named him a Cricketer of the Year in 2011. In ODIs, his first century came against Ireland, while in 2009 he answered Charles Coventry's unbeaten 194 for Zimbabwe with 154, a Bangladesh record, to win the game.
In March 2012 BCB president Mustafa Kamal had him removed from the home Asia Cup squad while he recovered from typhoid, overriding the selectors; he was later restored and made four straight fifties, a first for a Bangladesh ODI player. A knee tear in late 2014 required surgery in Australia, and at the 2015 World Cup he managed 154 runs in six innings, his best a 95 against Scotland in a chase of 319. Later that year, scores of 132, 116 and 64 made him Man of the Series as Pakistan were whitewashed for the first time, and his second-innings double hundred at Khulna secured a first Test draw against them. Bangladesh also beat India and South Africa in series that year.
He skipped the 2016 Asia Cup for the birth of his first child but returned for the World T20 in India, making 83 not out against the Netherlands and 103 from 63 balls against Oman to become his country's first T20I centurion and first to score hundreds in all formats. In October 2016 he became the first Bangladeshi to 5000 ODI runs, and his eighth Test century plus a quick 40 at the Sher-e-Bangla National Stadium helped beat England for the first time. At the 2017 Champions Trophy he hit 128, 95, 0 and 70 as Bangladesh reached the semi-finals.