The 36-year-old has played in 124 Tests since his debut against New Zealand in November 1993, with his wickets coming at an average of 21.64 runs.
Nicknamed "Pigeon" by team-mates due to his spindly legs, McGrath constantly troubled batsmen with his unerringly accurate line and length.
He and spinner Shane Warne, who is also retiring, formed a fearsome partnership that helped Australia dominate Test cricket for more than a decade.
After taking an eight-month break from cricket last year to care for his ill wife, McGrath was determined to leave Test cricket on his own terms and confound critics who said he could not come back at the top level.
He proved his point when he claimed 6-50 in the first innings of the First Test in Brisbane, jokingly holding his back like a geriatric as he shuffled off the field to the cheers of the Gabba crowd.
McGrath took five wickets in an innings 29 times and on three occasions managed 10 wickets in a match, with his best figures, 8-24, against Pakistan in Perth in 2004.
A notorious bunny with the bat, with an average of 7.37 runs in 138 innings, McGrath worked hard on improving his strokeplay, scoring 61 against New Zealand in 2004.
"Whenever people have written me off, I have always proved them wrong," McGrath said last year.
The farmer's son from the outback New South Wales town of Narromine showed little sign of age in his final Test appearance, taking three wickets on the final day, the last one a catch off tailender James Anderson.
"I guess if you had to write the script for the perfect ending, obviously to get a wicket on your last ball of Test cricket is the perfect way to do it," he said.
"Obviously, seeing off-stump cartwheel back 10-15 metres is probably the perfect scenario, but a slower ball caught at mid-on, I'll take that."
McGrath, who will still bowl in Australia's one-day team until after this year's World Cup in the West Indies, said his Test retirement had not yet sunk in.
"It will hit me more later down the track," he said.