The 36-year-old also said he was sorry for any damage the scandal would have done to the reputation of the game, adding that he was quitting as he did not want the scandal "to become an unwelcome disruption to the team" ahead of such a crucial series beginning on December 8 at the Gabba.
Following is the full statement of Paine, according to cricket.com.au:
From Blundstone Arena, Hobart.
"Today, I'm announcing my decision to stand down as the captain of the Australian men's Test team. It's an incredibly difficult decision, but the right one for me, my family, and cricket.
"As a background on my decision, nearly four years ago, I was involved in a text exchange with a then-colleague. At the time, the exchange was the subject of a thorough CA Integrity Unit investigation, throughout which I fully participated in and openly participated in.
"That investigation and a Cricket Tasmania HR investigation at the same time found that there had been no breach of the Cricket Australia Code of Conduct. Although exonerated, I deeply regretted this incident at the time, and still do today.
"I spoke to my wife and family at the time and am enormously grateful for their forgiveness and support. We thought this incident was behind us and that I could focus entirely on the team, as I have done for the last three or four years.
"However, I recently became aware that this private text exchange was going to become public. On reflection, my actions in 2017 do not meet the standard of an Australian cricket captain, or the wider community. I'm deeply sorry for the hurt and pain that I have caused to my wife, my family, and to the other party.
"I'm sorry for any damage that this does to the reputation of our sport and I believe that it is the right decision for me to stand down as captain, effective immediately. I do not want this to become an unwelcome disruption to the team ahead of what is a huge Ashes series.
"I have loved my role as captain of the Australian cricket team. It's been the greatest privilege of my sporting life to lead the Australian men's Test team. I'm grateful for the support of my teammates and proud of what we've been able to achieve together.
"To them, I ask for their understanding and forgiveness. To Australian cricket fans, I'm deeply sorry that my past behaviour has impacted our game on the eve of the Ashes. For the disappointment I have caused to fans and the entire cricket community, I apologise.
"I've been blessed with a wonderful, loving and supportive family, and it breaks my heart to know how much I've let them down. They have always stood by me, been my most loyal fans, and I'm indebted to them for their support.
"I will remain a committed member of the Australian cricket team and look forward with anticipation to what is a huge Ashes tour."