Germany's Michael Jung had a birthday to remember as he won double eventing gold on his mount Sam at Greenwich Park.
Jung was 30 on Tuesday and marked the day with a double clear round for team and individual gold.
He becomes the first eventer to hold the Olympic, European and world titles at the same time.
Sweden's Sara Algotsson-Ostholt, who was the last rider to go, looked on target to become the first woman to take the individual title but her grey mare Wega knocked the top pole off the final fence.
The four-point penalty left her on a combined total of 43.30, behind Jung on 40.60 with Germany's Sandra Auffarth third on 44.80.
Jung, who was making his Olympic debut in London, had a clear round in the morning session as the Germans held off the challenge of Great Britain to win team gold.
But despite his second clear round of the day in the afternoon jumping final, he admitted that he had resigned himself to getting individual silver as Algotsson-Ostholt came to the last.
"I was very happy with my second place but now my first place is even better," he said afterwards.
"You always dream that when everything goes perfectly you can win gold, but I never dreamed I'd have two," he said. "Now I'm going to have dinner with my family, and then party."
When asked to elaborate on what had gone wrong, the Swedish rider said: "At the triple combination before the last fence I told her [Wega] to be careful, to slow down.
"I tried to do the same at the last, but she didn't react so quickly and was too fast at it and just put down a toe."