In the Jawaharlal Nehru stadium, a two-and-a-half hour show of traditional dance, Bollywood music and huge fireworks gave the finishing sparkle to an event that survived rocky preparations and daily operational hiccups.
With many Indians pointing out that pessimistic international expectations had been proved wrong, organisers said their decision to hold the Games in fast-developing India was a major gamble that had paid off.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
Unfinished athletes' accommodation, security fears, big-name withdrawals and poor ticket sales were among a myriad of difficulties that got the Games off to an uncertain start.
But the occasion closed on a high after Indian athletes performed beyond all expectations to finish second in the overall medals table, sneaking ahead of England with a badminton gold late on Thursday.
Attendances at most venues improved dramatically, no militant attack materialised, and glitches over transport, and a stomach bug among swimmers were all overcome.
Britain's Prince Edward officially closed the Games in the presence of Prime Minister Manmohan Singh and Suresh Kalmadi, the chairman of the organising committee who bore much of the criticism about the Games.
"A month ago questions were being asked whether the Games would be held at all," admitted Kalmadi whose speech was greeted by boos by the crowd.
Instead the event had shown "India's ability to stand up and show the world what we can achieve, despite being faced with adversity," he said.
Most watched Games ever
"All this has made what has turned out to be the largest, the most watched and the most enjoyable Games ever."
The closing ceremony featured hundreds of dancers brandishing fighting sticks, military bands and children forming the Indian flag before the athletes arrived in a cheerful parade that set the evening's informal tone.
Glasgow marked the start of its role as Commonwealth Games host for 2014 with a lone bagpiper who was soon joined by 352 kilted dancers and an inflatable model of the elusive Loch Ness monster.
The Scottish city is likely to focus on solving Delhi's struggle to attract many world-class stars -- and it may also balk at matching the bill of the Delhi extravaganza, which is thought to have cost up to six billion dollars.
Doubts over the long-term prospects for the Commonwealth Games -- the third largest multi-sport event in the world after the Summer Olympics and the Asian Games -- were brushed aside in Delhi's party atmosphere.
The Games, in which 71 nations, nearly all from the former British Empire, compete, remains an unusual blend of popular sports such as athletics and lesser known ones such as lawn bowls and netball.
India's highlights included gold for the women's 4x400m relay team in the main stadium which was finally filled with a packed and noisy crowd, and ten wrestling golds.
Australia led the medals' table by a distance with 74 golds to India's 38 and England's 37. It also provided the stars of the Games with Alicia Coutts winning five golds in the pool and swimmer Leisel Jones collecting the tenth Commonwealth gold of her career.
The David Dixon award that recognises the outstanding athlete of the Commonwealth Games went to Trisha Smith of Jamaica who won the women's triple jump gold.

