Ainslie cemented his place as the most successful sailor in Olympic history after securing a fourth successive gold medal.
The 35-year-old replaced Denmark’s legendary Paul Elvstrom as the most decorated Games sailor after triumphing on home waters in front of thousands of supporters.
Ainslie faced fierce resistance throughout the week from Elvstrom's countryman Jonas Hogh-Christensen, although he managed to finish ahead of the Dane in yesterday’s medal race to increase his Olympic haul to four golds and a silver.
Yesterday’s drama unfolded in a nail-biting double points medal race in front of thousands of spectators in front of the packed Nothe Gardens.
Hundreds more were packed along the rocky shoreline to witness the momentous occasion.
The six-time Finn World Champion went in to the double points medal race two points behind leader Hogh-Christensen, knowing that to win gold he had to beat the Dane.
At one point it looked like Dutch sailor Pieter-Jan Postma was going to claim gold ahead of both of them but a collision near the finish with New Zealand sailor Dan Slater meant Postma had to do a penalty turn and missed out on a medal.
Ainslie finished in the race ninth ahead of Hogh-Christensen but on equal points.
He achieved victory overall – and made history by finishing ahead of the Dane in the medal race.
French sailor Jonathan Lobert took bronze after winning the medal race.
A tearful Ainslie said he had been greeted ashore at the Olympic sailing venue on Portland by his sister Fleur and her children.
He said: “They’ve been a fantastic support to me over the years, it's great to see them first.”
When asked what it felt like to be the world's greatest Olympic sailor, he added: “I can't really believe it to be honest, this event has been really hard.
“It's unbelievable and I'm just relieved to have got through today.
“I've never sailed such a nerve-racking race in my life; that course in those conditions, it was so hard.”
Ainslie sailed into the Weymouth and Portland National Sailing Venue with the union flag flying behind his heavyweight dinghy ‘Rita’.
He received applause and cheers, which increased when he went to assist Hogh-Christensen in with his boat.
Ainslie said: “Jonas has sailed brilliantly and so has PJ Postma, they've pushed me all the way so all credit to them, it was close.
“Coming down the final mark, PJ in a burst of desperation tried to get around the New Zealand sailor. He wasn’t in a very good tactical position to do that – it failed and then I knew I was in with a good shout.”
Ainslie, of Lymington, has strong links with Weymouth and Portland having grown up sailing and training on borough waters as a youth sailor.
OLYMPIC sailing champion Ben Ainslie will feature on a celebratory stamp.
Royal Mail is producing a stamp within 24 hours for every Team GB gold medal winner and Ainslie is the 15th Olympian to feature in the London 2012 Games.
Next-day production schedule for the ‘Gold Medal’ stamps uses a team of more than 100 staff to ensure the stamps are available at more than 500 post offices by lunchtime the day after a win at the Olympics .
Some additional branches will receive the stamps within a week.
The stamp can also be obtained from royalmail.com /goldmedalstamps