The United States and China finished the games with 40 gold medals each, but the United States topped the table because it had more silver medals.
Hollywood star Tom Cruise abseiled from the roof of the Stade de France, drawing gasps from spectators as Paris bid farewell to an Olympic Games hailed as one of its most successful.
Cruise climbed down a wire in front of 71,500 people, grabbed the Olympic flag and climbed onto a motorcycle, to the delight of athletes and fans.
In a sneak peek of what the world can expect when the next event takes place in Los Angeles in 2028, the Mission Impossible star, 62, appeared on screen boarding a plane and skydiving over the Californian city before adorning the iconic Hollywood sign with the Olympic rings.
The Los Angeles band Red Hot Chili Peppers, singer Billie Eilish and rappers Snoop Dogg and Dr Dre then performed a mini concert on a Los Angeles beach framed by the Pacific Ocean.
The closing show marked the start of the four-year countdown to the Los Angeles Games, with American gymnastics icon Simone Biles joining Los Angeles Mayor Karen Bass as the Olympic flag was formally handed over.
Earlier, International Olympic Committee President Thomas Bach described the Paris Games as “sport at its finest.”
“It was a sensational Olympic Games from start to finish,” Bach said. “Or dare I say it: a Seine-sational Games,” the IOC chief joked about the River Seine, where the opening ceremony and the triathlon and marathon swimming events were held.
In what will be Bach's last Games after announcing his intention to step down next year, the IOC chief also called for “a culture of peace” in a world devastated by war.
“We know that the Olympic Games cannot create peace, but they can create a culture of peace that inspires the world,” he said. “Let us live this culture of peace every day.”
'Magic'
Some 9,000 athletes danced and sang all night during the closing ceremony, which was billed as a celebration of humanity and the unifying power of sport.
“We knew you would be brilliant, but you were magical,” Paris 2024 head of organisation Tony Estanguet told the athletes. “You made us happy, you made us feel alive; the world needed this moment so much.”
The ceremony began with Leon Marchand, who won four gold medals in swimming for France, collecting the Olympic flame from the cauldron in the Tuileries Gardens to begin its journey to the stadium.
Marchand later reappeared at the stadium to chants of “León, León” and extinguished the flame.
The ceremony followed 17 days of often impressive sporting action, set against the backdrop of Paris' most iconic landmarks, from the Eiffel Tower to the Palace of Versailles.
In contrast to the rain-soaked opening ceremony, Sunday's celebrations at the national stadium began as a golden sunset bathed the French capital.
China and the United States battled for first place until the final day, when the U.S. women's basketball team edged out France 67-66 to secure the final gold of Paris 2024.
The win, the eighth consecutive Olympic women's basketball title for the United States, gave the country its fourth gold, equaling China. However, the United States topped the medal table because it had more silvers and medals.
At a press conference on Sunday, Zhou Jinqiang, deputy head of the Chinese delegation, praised the country's athletes for their “record-breaking performance” in taking home a total of 91 medals.
“This is China's best performance at an overseas Olympic Games since it started participating in the Summer Olympics in 1984,” Zhou said. China won 100 medals and topped the table for the most gold medals when it hosted the Games in Beijing in 2008.
Japan, which hosted the last Olympics in 2020, also celebrated its best performance at an overseas Games, finishing third with 20 golds.