His Test career began badly against Australia at Sydney, where he bowled 16 overs without a wicket and gave away 72 runs, and he was then left out. Recalled for the home series against India, he turned things around in the third Test at Karachi in 2006, tearing through the Indian top order and taking seven wickets in the match to set up a Pakistan win. In a Test at Kandy he claimed his first five-wicket innings and first ten-wicket match as Pakistan secured a series victory over Sri Lanka, finishing that two-Test series with 17 wickets. On the 2007 tour of South Africa he took 19 wickets in three Tests at an average of 18, and across the 2009/10 trips to New Zealand and Australia he collected 32 wickets in six Tests. In England in 2010 he reached 100 Test wickets in only his 20th match.
Trouble followed him throughout. He and Shoaib Akhtar failed drug tests for nandrolone and received two-year bans from the PCB, which an appeal tribunal overturned. WADA took the matter to the Court of Arbitration for Sport, and amid the uncertainty Asif missed the 2007 World Cup; the case was later dropped in 2007. In 2008 he was held at Dubai Airport on suspicion of carrying illegal drugs and was barred from ever entering the UAE again.
The heaviest blow came at Lord's in 2010, when a News of the World investigation accused him, Mohammad Aamer and Salman Butt of spot-fixing; Asif was charged over deliberate no-balls. Convicted at Southwark Crown Court of conspiring to cheat at gambling and to accept corrupt payments, he received a one-year prison sentence and a seven-year ban from the game. His bid to shorten the ban at the Court of Arbitration for Sport failed in April 2013, and in August 2013 he admitted his involvement in spot-fixing.