Last year, Kohli had stepped down as the T20I captain and then he was removed as the ODI leader as the selectors wanted one captain for the white-ball format.
"It's been 7 years of hard work, toil and relentless perseverance everyday to take the team in the right direction. I've done the job with absolute honesty and left nothing out there. Every thing has to come to a halt at some stage and for me as Test Captain of India, it's now. There have been many ups and also some downs along the journey, but never has there been a lack of effort or lack of belief. I have always believed in giving my 120 percent in everything I do, and if I can't do that, I know it's not the right thing to do. I have absolute clarity in my heart and I cannot be dishonest to my team," Kohli said in a statement.
"I want to thank the BCCI for giving me the opportunity to lead my country for such a long period of time and more importantly to all the teammates who bought into the vision I bad for the team from day one and never gave up in any situation. You guys have made this journey so memorable and beautiful. To Ravi Bhai and the support group who were the engine behind this vehicle that moved us upwards in Test Cricket consistently, you all have played a massive role in bringing this vision to life. Lastly, a big thank you to MS Dhoni who believed in me as a Captain and found me to be an able individual who could take Indian Cricket forward," he added.
Kohli's decision to leave Test captaincy comes a day after India lost the three-match Test series against South Africa on Friday.
Virat Kohli's biggest win in the longest format came during 2018-19 as India won its first Test series Down Under. Under his captaincy, India also reached the finals of the World Test Championship (WTC).
It needs to be pointed that Kohli has not registered a century in international cricket since November 2019. He last scored a ton against Bangladesh in the day-night Test at the Eden Gardens.
(With Inputs from ANI)