The 37-year-old former said Thursday the third test against South Africa starting Friday will be his last.
Ponting will equal Steve Waugh's record of 168 test appearances for Australia in the Perth match and he retires with a current test total of 13,336 runs, second only to Sachin Tendulkar.
His decision follows some poor form in the first and second tests and a meeting Wednesday with the Australian selectors.
"Over the last couple of weeks my level of performance hasn't been good enough,'' Ponting said. "My passion and love for the game hasn't changed.
Ponting informed his teammates of his decision Thursday morning and the entire Australia squad attended the news conference at which he made his retirement public. He said he will continue to play for Tasmania state until the end of the current season and captain a Prime Ministers XI against Sri Lanka in early 2013.
"At the end of the day (the decision) was based on my results. In this series so far they have not been up to the level required of batsmen and players in the Australian team.
"I'm glad to have got the opportunity to finish on my terms.''
Ponting said he hoped to finish his test career with a victory over South Africa, which would give Australia a 1-0 series win after the first two matches were drawn.
Cricket Australia chief executive James Sutherland said he and Ricky exchanged text messages earlier Thursday after Ponting made his decision overnight.
"Ricky has had an extra-ordinary career and has made an extra-ordinary contribution, including through the example he has set for other elite players and through the excitement he has given fans, young and old,'' Sutherland said in a statement.
Ponting made his test debut against Sri Lanka in Dec. 1995, just 10 months after playing in his first one-dayer for Australia against South Africa.
He replaced Steve Waugh as Australia's 42nd test captain in 2004 before handing the reigns to Michael Clarke last year. He played his last ODI in February against India.
An emotional Clarke found it difficult to answer questions about Ponting's retirement at a media conference ahead of the third test.
"No I didn't have a feeling it was coming,'' Clarke said. "The boys are obviously hurting, he has been an amazing player for a long time.''
Clarke then appeared to choke back tears before adding; "And that will do me for today. Sorry I can't answer that.''
Sutherland said he hoped Ponting would stay connected to the game in an official capacity after his test career.
"I think his record until he retired as captain was outstanding, but my respect for him since then has actually increased, seeing first-hand how he stepped back to become a total team player, absolutely committed to his captain, unstinting in his work to help other players and single-minded in his view that everything, including his own ambition, must always be second place after whatever was best for the team''.