Flame throwers, blazing torches and a gigantic heart of fire lit up the Olympic Stadium in a Festival of Flame as some of the world's best musical artists performed to a delighted audience.
The ceremony began with the grit and determination of Captain Luke Sinnott, who hauled himself up a flagpole to fly the Union Flag.
The 32-year-old lost his legs in Afghanistan in 2010 after volunteering to search an area "saturated" with improvised explosive devices to protect his comrades.
Stephen Daldry, London 2012's executive producer for opening and closing ceremonies, said the flag unveiling was "devastatingly emotional".
A mass of drummers created an avenue through which the Earl of Wessex and International Paralympic Committee chairman Sir Philip Craven entered the stadium.
They arrived in a custom-built car that began life as a military vehicle in Afghanistan and was driven by Captain Tony Harris, who lost his a leg below the knee in a blast in Afghanistan in 2009.
Blind autistic singer Lissa Hermans, who performed at the Queen's Diamond Jubilee, sang the National Anthem.
The ceremony also featured global megastars Coldplay, Rihanna and Jay-Z.
Coldplay frontman Chris Martin said: "Being asked to play at the closing celebrations for the Paralympic athletes in London is such a great honour for us.
"It was one of the biggest nights of our lives and we were excited to try to create a performance - that closed London 2012 in style."
Rihanna added: "Being at the Paralympics is the biggest honour. These athletes are gladiators and are a true inspiration."
The audience roared as Britain's joint flag-bearers – wheelchair racer David Weir and cyclist Sarah Storey – who each won four golds, were joined by athletes from each country. The ceremony included stunning effects and more than 1000 people, including disabled performers who learned circus skills for the show.
Soldier Rory Mackenzie, whose leg was blown off by a roadside bomb in Iraq, praised Paralympians' "indomitable human spirit." He told the crowd: "Tonight we bring you the Festival of the Flame, the symbol of the spirit of the Games, which has burned bright at London 2012.
"Tonight we celebrate that spirit and although we have many differences, there is one quality we all share, one thing all of us have in common: human spirit.
"We have all been touched by the triumphs and drama of the Paralympics, witness to the indomitable human spirit of the athletes."
Earlier, Prime Minister David Cameron said the efforts of wheelchair athletes made him reflect on his disabled son, Ivan, who died in February 2009 after suffering severe cerebral palsy and epilepsy.
He said: "As every parent, you think of all the things they can't do. But actually the Paralympics is about how they are super-human, about all the things they can do."
As the ceremony drew to an end, London mayor Boris Johnson passed the Paralympic Flag to the mayor of Rio, Eduardo Paes. Swimming star and face of the games Ellie Simmonds, 17, also joined sprinting sensation Jonnie Peacock, 19, to play a part in the finale.
As the Paralympic cauldron was extinguished they transferred the final flame to a London Paralympic Torch, which was used to light hundreds of torches held by members of the cast across the field.
Fountains rose from circular stages to finally extinguish the Paralympic Flame.
The stunning send-off ended with a spectacular firework display that flashed over the Olympic Stadium and Park.
Finally the words "Thank you London, thank you UK" were projected onto the Houses of Parliament.
Contextual targeting label: