Ali made his representative international debut for the Afghanistan U-17 cricket team against the United Arab Emirates Under-17s in 2004. Ali's debut for the senior team came against Saudi Arabia in the 2006 Middle East Cup.
Ali made his Twenty20 debut for Afghanistan in the 2007 ACC Twenty20 Cup against Oman.
Ali was a part of the rapidly rising Afghan cricket team that from 2008 to 2009 won the World Cricket League Division Five, Division Four and Division Three, therefore promoting them to Division Two and allowing them to take part in the 2009 ICC World Cup Qualifier's.
In the World Cup Qualifier, he made his List-A debut against Denmark. Later in the tournament, Ali scored 122 against Canada in the Super Eights in the 2009 ICC World Cup Qualifier; this match predated Afghanistan's ODI status (achieved later in the tournament), but was a List A game. During the tournament Afghanistan gained ODI status. He made his One Day International debut against Scotland, where he scored 45 runs.
Afghanistan's success in the World Cup Qualifier qualified the team for the 2009–10 ICC Intercontinental Cup in which they would regularly play first-class cricket against Associate countries.
Ali's first-class debut came in Afghanistan's first first-class match against a Zimbabwe XI. The Zimbabwe XI contained some players with experience of Test cricket – such as their captain and wicket-keeper Tatenda Taibu, and fast bowler Christopher Mpofu – and ODI cricket. Ali opened the batting for the inexperienced Afghanistan team and scored a century on his first-class debut. He made 130 runs from 200 deliveries before he was dismissed by leg-spin bowler Tafadzwa Kamungozi. In Afghanistan's second innings, Ali followed up his heroics in the first innings by hitting exactly a hundred and remaining unbeaten when the match was declared a draw. Only three other players: Arthur Morris, Nari Contractor and Aamer Malik have hit centuries in both innings of their debut first-class match.
During Afghanistan's tour of the Netherlands in 2009, Ali made a vital half century contribution in Afghanistan's second innings during their Intercontinental Cup match against the Netherlands, helping Afghanistan to a 1 wicket victory. In November 2009, Ali was a key member of Afghanistan's ACC Twenty20 winning squad.
In January 2010, Ali continued his fine form in first-class cricket by scoring two fifties in Afghanistan's Intercontinental Cup victory over Ireland, with scores of 53 and 57. Following the Intercontinental Cup victory, he made his full Twenty20 International debut against Ireland in the 2010 Quadrangular Twenty20 Series in Sri Lanka. Following the tournament, Ali was a member of Afghanistan's victorious 2010 ICC World Twenty20 Qualifier winning squad and was later named in Afghanistan's squad for the 2010 ICC World Twenty20.
Following the tournament, Ali made his maiden ODI century, with a score of 114 against Canada at Sharjah. In the following Intercontinental Cup match with Canada, he scored 52 runs in Afghanistan's second innings, sharing an opening stand of 70 with Karim Sadiq as Afghanistan successfully chased 494 for victory. In April, Ali was a key member of Afghanistan's 2010 ACC Trophy Elite winning squad which defeated Nepal in the final. Earlier in the tournament he scored 108 runs from 88 balls against Bhutan.
In Afghanistan's inaugural match in the 2010 ICC World Twenty20 against India, Ali struck 50 from 48 balls and shared in a paternership of 68 with Asghar Stanikzai. Ali's 50 could not save Afghanistan from a 7 wicket defeat. In the team's second match against South Africa, Ali was one of a number of Afghan batsman who were unable to cope with the express pace of the South African attack, with Ali being caught behind by Mark Boucher from the bowling of Dale Steyn.In the column Runs, * indicates being not outThe column title Match refers to the Match Number of the player's career