Quinton de Kock has announced a sudden retirement from Test cricket with immediate effect "to spend more time with his growing family". de Kock was due to miss the second and third Tests against India on paternity leave but has decided to step away from the longest format entirely. He remains available to play white-ball cricket for South Africa.

"This is not a decision that I have come to very easily," de Kock said in a statement issued by CSA. "I have taken a lot of time to think about what my future looks like and what needs to take priority in my life now that Sasha and I are about to welcome our first child into this world and look to grow our family beyond that. My family is everything to me and I want to have the time and space to be able to be with them during this new and exciting chapter of our lives.

"I love Test cricket and I love representing my country and all that it comes with. I've enjoyed the ups and the downs, the celebrations and even the disappointments, but now I've found something that I love even more.

"In life, you can buy almost everything except for time, and right now, it's time to do right by the people that mean the most to me.

"I would like to take this opportunity to thank everyone who has been a part of my Test cricket journey from the very beginning. To my coaches, teammates, the various management teams and my family and friends - I couldn't have shown up as I did without your support.

"This is not the end of my career as a Protea, I'm fully committed to white-ball cricket and representing my country to the best of my ability for the foreseeable future.

"All the best to my teammates for the remainder of this Test series against India.

"See you in the ODIs and T20s."

de Kock, 29, began 2021 as South Africa's temporary Test captain and ended it by retiring from the format. He led South Africa in four Tests, against Sri Lanka and Pakistan, with a 50% win record. South Africa beat Sri Lanka 2-0 at home but lost in Pakistan by the same margin.

de Kock had expressed concerns with the restrictions of bubble life in the Covid-19 pandemic and was rested from South Africa's ODIs in Sri Lanka and against Netherlands.

"It's sad to lose a player of Quinton's calibre at what we still see as the prime of his career and relatively young life, but family, as we all say here at CSA, is everything," CSA acting CEO Pholetsi Moseki said in the statement. "He has been a loyal and proud servant of the Proteas team for the last seven years and we are glad that we have not lost him from the game entirely."

de Kock was also one of several players - all white - who opted not to take a knee when South Africa decided to give their players the option of taking a knee, raising a fist or standing to attention. He chose none of those on the first outing where they made gestures for anti-racism, in the West Indies, but raised a three-finger salute in tribute to a friend who had been wounded in Afghanistan and showed his support for rhino conservation.

At the T20 World Cup, when CSA mandated players to take the knee, de Kock initially refused and missed the game against West Indies as a result. He subsequently apologised and has taken the knee since.

de Kock made his Test debut against Australia in 2014 and played 54 Tests, scoring 3300 runs at an average of 38.82 with six centuries.

His first century came at the same ground he played his last Test - SuperSport Park - when he scored 129* at No. 7 as South Africa beat England by 280 runs in 2016. He went on to score a match-winning hundred in Hobart later that year, which helped South Africa to a third successive series win in Australia. He averaged 63.18 in 2016, his best in a calendar year.

Firdose Moonda is ESPNcricinfo's South Africa correspondent