Steyn in a statement released by Cricket South Africa (CSA) said that he has taken the decision so as to prolong his career. CSA also clarified that the 36-year-old remains a national contracted player for the 2019/20 season and will be available for ODI and T20I selection.
"Today I walk away from a format of the game I love so much. In my opinion Test cricket is the best version of this game. It tests you mentally, physically, emotionally," said Steyn in his statement.
"It's terrible to consider never playing another Test again but what's more terrifying is the thought of never playing again at all. So I will be focusing on ODIs and T20s for the rest of my career to maximise my full potential and ensure my longevity in this sport.
"I'd like to thank everyone in cricket, no one specific, because everyone has been a part of my journey. And I look forward to continuing to play for the Proteas in the shorter formats. Thank you."
Steyn made his Test debut against England in 2004. With 439 wickets in 93 matches, he is South Africa's all-time highest wicket-taker in the format. His last Test for the Proteas was against Sri Lanka in February.
( With inputs from IANS )