Matt Kuchar finished the four rounds on 271 strokes and Haotong Li from China was third following a dashing 63 shot final round to register 274 shots over the four days.
Spieth finished the first day on 20 July in a three way tie for first place with Kuchar and Brooks Koepka. But he was sole leader after shooting 69 on 21 July and 65 on 22 July.
But there was nearly another meltdown from Spieth equal only in recent times to his own collapse in the 2016 Masters, when he threw away a five stroke lead halfway through his final round to hand the green jacket to Danny Willett.
"This was eventful. But there are a lot of roads to get there," Spieth said after receiving the Claret Jug trophy and a 1.6 million euro winner's cheque.
"I was in a tough one early on in the final round but I showed resilience. As you can imagine thoughts came in from my last scenario where I was leading a major on a Sunday.
"The wheels had kind of come off everything and we were trying to work out how to get back on track to salvage the round."
Spieth will celebrate his 24th birthday on 27 July and is the youngest winner of the Claret Jug since the Spaniard Seve Ballesteros triumphed at Royal Lytham in 1979 aged 22.
Spieth's win also ends a run of seven consecutive majors going to players who had never claimed one of golf's biggest prizes.
Kuchar had been hoping to extend that sequence and become the sixth champion from the last seven Opens aged 39 or older.
"It's crushing. And there is excitement and a thrill to have played well, put up a battle," said Kuchar. "You work so hard to get to this position, you don't get many opportunities. To be this close, taste it with five holes to go, it's a hard one to sit back and take."
Li's last gasp rise is the best finish for a Chinese golfer in a major. "It's kind of a dream come true," said the 21-year-old.