In a final round that stirred memories of Jean Van de Velde's collapse eight years ago, Harrington lost a one-shot lead on the 72nd hole by hitting into the Barry Burn twice for a double bogey, only to get another chance when Sergio Garcia couldn't make par from a bunker.
Staked to a two-shot lead in the four-hole playoff against the Spaniard, Harrington played it safe the second time around on the 18th.
He hit iron off the tee, and another one to stay short of the burn. But a gutsy play by Garcia, who smoked a 6-iron from 203 yards out of the rough to birdie range, forced Harrington to make a nervy 3-footer to become the first Irishman in 60 years to win the claret jug.
Harrington thrust his fists in the air, a survivor as much as a champion, and before long he was waving the Irish flag and doing his best to stop the tears.
"I think if I had lost, it would have been hard to take it," Harrington said. "But because I had a chance, I didn't let myself get down about taking a 6. I convinced myself if there was a playoff, I would do the best in it."
It was a devastating loss for Garcia, who had a three-shot lead going into the final round and was poised to win a major championship he has been chasing since he was a teenager. He was 10 feet away from winning, and his par putt on the 18th hole in regulation looked good all the way until it dipped slightly on the left side and spun out.
"To tell you the truth, I don't feel like I did anything wrong," said Garcia, who closed with a 73 and was 1 over in the playoff. "I really didn't miss a shot in the playoff. I hit unbelievable putts. They just didn't go in."
Harrington, who closed with a 4-under 67 to make up a six-shot deficit, played the four playoff holes in even par, seizing control with a 7-iron into 8 feet for birdie on the first hole as Garcia made bogey from a bunker.
A rainbow stretched over the course by the North Sea, capping another magical day on perhaps the toughest links in golf.
Like the last Open at Carnoustie, there was chaos in the end.
Only this time, it involved more than one player.
Van de Velde self-destructed on his own in 1999, blowing a three-shot lead on the final hole by hitting one shot off a tiny rail in the grandstand, another into the burn, another in the bunker.
Eight years later, the bad luck belonged to Andres Romero of Argentina, who looked like another unlikely champion at Carnoustie until his 2-iron from the rough on the 17th hole ricocheted off the stone wall of Barry Burn and across the 18th fairway, out-of-bounds. He finished third, a stroke behind, after a 67 which included 10 birdies but two double bogeys.
The bizarre bounce went to Harrington, whose tee shot on the 18th hole hopped along a bridge over the burn until it went between two rails and into the winding stream. He also chunked his next shot into the burn, then made a clutch putt from 5 feet for double bogey.
That left only bad timing for Garcia.
It was his third time to play in the final group of a major, this time with Tiger Woods out of the picture early. But the 27-year-old Spaniard couldn't buy a putt, and he couldn't get a break.
Two shots down with two holes to go in the playoff, and with Harrington in trouble right of the par-3 16th green, Garcia watched in disbelief as his tee shot smacked the base of the pin and went 18 feet away.
He missed the birdie putt. He missed a lot of putts in the final round, which remains the weakness in his game.
"Every time I get in this position, I never have any room for error," Garcia said. "I should write a book on how not to miss a shot and not win a playoff."
But he missed several shots, muttering to himself, pleading on one occasion, "Please, please, please my God, please."
He closed with a 73, joining Harrington in the playoff at 7-under 277. The winning score was 13 shots lower than it was the last time at Carnoustie, but everything else — especially the final holes — was eerily similar.
Almost lost in the crazy finish was Harrington, who ended Europe's eight-year drought without a major.
Winner for the past two years, Woods finished in a tie for 12th after a final round 70 left him five behind Harrington and Garcia.