Rhodri Morgan said he considered himself a "very lucky man" as he left hospital on Wednesday.
Rhodri Morgan was admitted to hospital on Sunday night
The first minister was treated with stents for two partially-blocked arteries after being admitted to hospital with severe chest pain.
He said the procedure meant a "much more severe" heart operation could be avoided in the future.
As Mr Morgan left for home, Ieuan Wyn Jones addressed the assembly for the first time as deputy first minister.
Mr Morgan, 67, was admitted to hospital on Sunday night suffering from what a spokesman described as "gastric problems".
After spending the night in Llandough Hospital in Penarth, he was transferred to the University Hospital of Wales in Cardiff, for an angiogram, which is an X-ray image showing blood vessels.
Two stents - meshes or plastic tubes used to keep blood vessels open - were later inserted in a "standard surgical procedure" and Mr Morgan was conscious throughout.
Speaking outside the University Hospital of Wales, he said: "I consider myself to be a very lucky man because when it was detected on Sunday afternoon by the severe chest pain I had, it meant that the intervention of doing the stents - the little bit of plastic pipe they put in to replace the damaged bits of artery - means you avoid a much more severe heart operation later on."
He showed journalists a small cut on his right wrist - the only mark left by the treatment.
"That was at 1500 BST on Monday, so 48 hours later you're able to go home and so long as you're sensible you can go back to a normal life," he said.
"I was a huge admirer of the NHS before. I am an even greater admirer of the NHS now.
"Now I have got an extra reason to say the NHS is the best health service in the world."
Mr Morgan will be able to go back to work the week after next, and may be able to resume light duties next week.
His first tasks will be to finalise talks over the coalition with Plaid Cymru, and to choose a new joint cabinet.
On Monday, talks on how many seats - and which posts - Plaid will fill were postponed because of Mr Morgan's hospital admittance on Sunday.
Just days before, both parties had voted in favour of an unprecedented coalition, which Labour sought after failing to win a majority at the assembly election on 3 May.
During his first address to the assembly as deputy first minister on Wednesday, Ieuan Wyn Jones wished Mr Morgan a speedy recovery and said he hoped to see him back at work soon.