Phew. When stumps were finally drawn, everyone was exhausted after an extraordinary day of record-tumbling drama. But the most exhausted of all was Mahela Jayawardene after one of the finest innings in the history of Test cricket. His 374 was the fourth highest in the all-time list of individual scores, but mere statistics, important as they are, don't tell the full story.
Jayawardene produced a flawless exhibition in batsmanship that possessed an almost unreal quality. For 12 hours he was perfection personified, very rarely beaten and chanceless throughout. This is worth repeating: during an innings that spanned three days and 572 deliveries, he did not offer South Africa's fielders a single chance. He was finally dismissed but it was a devilish delivery that kept low to uproot his off-stump.
For 65 overs Nicky Boje bowled with great discipline, directing the ball into the rough outside his leg-stump, a tactic designed to stymie his run-scoring. To an extent it was successful too as it made Jayawardene work harder for his runs, but it also highlighted just how skilfully he'd played as he precisely worked the ball off his legs and showed-off immaculate use of his feet. The inside-out lofted cover drives were glorious, princely strokes.
At the other end, for approximately 11 hours, was his best friend: Kumar Sangakkara. It is not surprising that they are, statistically, the second most prolific partners in Sri Lanka's history after Sanath Jayasuriya and Marvan Atapattu because there is an obvious chemistry in the middle. They matched each other throughout, almost run-for-run, until Sangakkara started to become becalmed as he approached a triple century, each man helping the other through tricky periods, running intuitively between the wickets. By the end they'd almost stopped calling.
When the day started it was clear that they were not going to let history pass them by. After a Thai dinner last night, they'd gone to bed early. Jayawardene woke up the sorest and during the first 45 minutes they focused purely on re-establishing their dominance. Soon Sangakkara, the aggressor at the start of the partnership, adopted a more cautious approach and Jayawardene became gradually more positive; always solid, relaxed and patient, but ruthless when any scoring opportunity arrived.
They passed Jayasuriya and Roshan Mahanama's world record stand of 576 with a sense of inevitability. Neither appeared nervous. Indeed, throughout, there was an emotionless serenity to their stand, the fierce unblinking concentration only broken by wide smiles and warm hugs as each milestone passed - double hundreds, world record stand, personal bests, Jayawardene's triple hundred, the highest by a Sri Lankan. When the firecrackers did erupt after passing 576, engulfing the ground in smoke, Sangakkara looked almost peeved, annoyed that his concentration may be compromised by all the innocuous gunpowder floating around.
To their huge credit, South Africa did not wilt. Other less proud and patriotic opponents would have thrown in the towel. There was some general untidiness in the field but the wheels never came off. In fact, most of the bowlers, especially the luckless Boje, had good days. Jayawardene and Sangakkara were forced to battle harder and harder for their runs. To their even greater credit, their congratulations at the end to Jayawardene were warm and heartfelt.
Jayawardene will no doubt go to bed disappointed. Most cricket fans would sacrifice their leg to score a flawless 374 in a Test match. But he'd climbed to within touching distance of Lara when a wicked delivery ended it all - a delivery that he will replay a thousand times again in his head for the rest of his life. However, he should not rue the missed record, he should cherish the deliciousness of what went before. If he is not on a rehydration drip tonight, he deserves a glass of the finest champagne - with Sangakkara, of course.
But all the batting heroics will mean much less if Sri Lanka are not able to force a victory and Jayawardene will now focus on the task of dismantling South Africa's second innings. It won't necessarily be easy too, as South Africa hinted with a resolute start to a long rearguard. The pitch, despite increasing variations in bounce and slow turn, remains docile and Sri Lanka must not make the same mistake that England made at Lord's back in May, assuming victory is an inevitability.
Charlie Austin is Cricinfo's Sri Lankan correspondent