In 2004, he became the first Yorkshire-born player of Asian extraction to play for Yorkshire. In his only first-class appearance in 2006, he failed to take a wicket, and scored just two runs. He enjoyed more success in the shorter formats of the game, claiming five wickets and 18 runs in four List A matches for his native county, and in his sole Twenty20 appearance, he took 2 wickets. In 2009, Shahzad took 40 wickets and scored 445 runs in the lower middle order. His performances gained him a call up to the England performance squad on a tour of South Africa, where he impressed coach Andy Flower. In the 2011 County Championship he managed 25 wickets at a bowling average of 41.00. In September, Shahzad was reprimanded for scuffing the pitch during the penultimate Championship match against Warwickshire and fined £750. The club was relegated from the First Division in the final match of the season. Shahzad regretted the incident, explaining "It's not the way I want to play my game. I don't want to be seen as a cheat, or a pitch-damager. ... It's one mistake I've made in an eight- or nine-year career so far. It's out of the blue for me, and I definitely would never do anything like it again. It was just a random, stupid act." In April 2012 Yorkshire's new bowling coach, Jason Gillespie, praised Shahzad's efforts, saying "Ajmal has got himself in as good a condition as he's ever been in his first-class career. He's worked incredibly hard, and I think he's a fantastic bowler, a very exciting bowler." However, on 1 May 2012, it was announced that Shahzad was to leave Yorkshire and a week later he joined Lancashire on loan for the rest of the season. On 10 October 2012, having been told he was free to leave Yorkshire, Shahzad signed a three-year contract to join Nottinghamshire. On 7 November 2014, he was released a year early from his Nottinghamshire contract and signed a three-year contract with Sussex. On 10 July 2017, Shahzad departed Sussex after his contract was terminated by mutual agreement.
International career
In January 2010, he was named in the Test and ODI squads for the England tour of Bangladesh. On his debut for England in a Twenty20 International against Pakistan, he claimed two wickets, both in his first over. He then made his ODI début against Bangladesh, again taking a wicket in his first over. When Bangladesh toured England a few months later, he made his Test debut in the second Test, replacing the injured Tim Bresnan. After only scoring 5 runs in England's innings and an expensive first bowling spell, he took 3 wickets in 3 overs in his second spell as Bangladesh failed to reach the follow-on target. Pakistan toured England in July and Shahzad was included in England's 12-man squad for the first Test. A week before the match, he twisted his ankle whilst playing for Yorkshire. As he was still experiencing discomfort the day before the Test, England chose to play Tim Bresnan instead of Shahzad. Though pundits had expected Shahzad to be included in England's squad for the 2010–11 Ashes, he was omitted from the 16-man touring party. However, he was included in the performance squad who were training in Australia and ready to provide cover in the event of injuries. He was not called upon in the Tests, but played two T20Is against Australia and the first five of the seven ODIs that followed. He took 6 wickets at an average of 40.50 before a hamstring injury in the fifth match ruled him out of the rest of the series. Shahzad was included in England's 15-man squad for the 2011 ICC World Cup held in Bangladesh, India, and Sri Lanka in March 2011. He managed three wickets from two appearances in the tournament, but suffered a recurrence of the hamstring injury against Australia forcing him out of the tournament prematurely. On his return to Yorkshire, he struggled for form so was left out of the England Test and ODI squads to face Sri Lanka in 2011. He was selected in the England Performance Programme held over the 2011-12 English off-season, but never played international cricket again.