Three shots clear of Matt Kuchar heading into the final round, Spieth bogeyed three of the first four holes to see his overnight advantage wiped out.
The 23-year-old then found himself trailing by one after a remarkable bogey at the 13th, where he was forced to take a penalty drop on the driving range after a poor drive.
However, Spieth stormed back into the lead, birdying the 14th before picking up an eagle on the 15th and shaving another stroke off his card on the 16th and 17th.
Par at the last completed a remarkable closing 69 and a 12-under-par total of 268, three shots ahead of Kuchar, who also shot 69 after a bogey on the last.
The victory means that Spieth joins Jack Nicklaus in becoming one of just two players to win three Majors before the age of 24.
In addition the world number three, who turns 24 on Thursday, is the youngest Open winner since 22-year-old Seve Ballesteros won the first of his three titles in 1979.