South Africa batter Zubayr Hamza has been banned for nine months after testing positive for a heart medication he said he took by accident.
Hamza, 26, told the International Cricket Council (ICC) he intended to take his own medication but instead ingested his father's heart medication.
The ICC accepted his explanation and gave him a shorter ban, but he will miss this summer's tour of England.
He played the last of his six Tests in February against New Zealand.
Hamza averages 17.66 from six Tests with a high score of 62 and played three Tests against England in the 2019-20 series.
He provided an out-of-competition sample in January in which the prohibited substance Furosemide was found.
The ICC's integrity unit said it "established no significant fault or negligence on his part".
"I have never intentionally taken a prohibited substance and I am relieved that the ICC determination confirms this fact," Hamza said.
"The past few months have been difficult for me on a personal and professional level, and I have learnt lessons that I will share with my fellow players."
The ICC integrity unit manager Alex Marshall said the case is a "timely reminder" cricketers "remain responsible for anything they put into their bodies" and to "know exactly what medication they are taking".
- Sport's transgender conundrum: What happens next as sport wrestles with a complex balance of inclusion, sporting fairness and safety?
- How do you become a football manager? Former Preston North End, Leeds United and Sunderland gaffer lets us in on the secret