"I've done the job with absolute honesty and left nothing out there. Everything has to come to a halt at some stage and for me as Test captain of India, it's now," Kohli announced on Twitter on Saturday.
"It's been seven years of hard work, toil and relentless perseverance every day to take the team in the right direction.
"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 per cent in everything I do, and if I can't do that, I know it's not the right thing to do. I have absolutely clarity in my heart and I cannot be dishonest to my team"
Kohli, 33, has now given up the captaincy of all Indian teams, having also stood down as Twenty20 captain in September and being replaced as the one-day team leader in December. Rohit Sharma has taken over in both formats.
He added: "I want to thank the BCCI (Board of Control for Cricket in India) for giving me the opportunity to lead my country for such a long period of time and more importantly to all the team-mates who bought into the vision I had 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 (Shastri) 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 captain and found me to be an able individual who could take Indian cricket forward."
Kohli, who took over the reins in 2014, led India in 68 Tests, winning 40 matches and losing 17.
"BCCI congratulates Virat Kohli for his admirable leadership qualities that took the Test team to unprecedented heights," a statement from the BCCI on Twitter read.
"He led India in 68 matches and has been the most successful captain."