Almost 5,000 athletes attended the Games, making it the biggest Games. New Caledonia topped the medal table with 76 gold medals.
The closing ceremony began with many of the athletes, some wearing their medals, walking a lap of Apia Park Stadium athletics track, past the flaming cauldron, which had seen five days of action this week.
It ended with fire dancing and fireworks, including an illuminated "tofa soifua Pacific" message of farewell to the departing teams.
Many of the 3,000 volunteers who contributed to the running of the Games, from catering and logistics to helping at sporting venues, received a huge cheer as they paraded in their red uniforms.
The prime minister, who was an archer in Team Samoa, but withdrew from bronze medal contention to allow his younger team mate to take his place, addressed the thousands of performers, athletes, volunteers and fans in the stadium.
PM Tuilaepa Lupesoliai Sailele Malielegaoi said: "What a feast of athletic talent, prowess and courage we have seen in the last fortnight.
"Not only has the Pacific Games become a great regional sporting event, but it is truly inscribed with much deeper cultural and political importance."
He said the Games in Samoa "for some may be the only chance-in-a-lifetime experience."
"Samoa has been privileged with a fortnight filled with triumphs and disappointments.
"But for all of you who have worked so hard to be selected onto your country teams, to have made it this far, to compete at this level is a significant accomplishment. Winning medals is the crowning glory but in the end it is the extra effort that separates a winner from second place."
He added: "To all the medal winners I offer our heartiest congratulations. And to those who fell short, I say congratulations as well. You all represent the best of your respective countries have to offer and all of you ought to be proud of how you have performed."
He thanked the volunteers, the 2,000 school children who performed at both opening and closing ceremonies, the ministries involved, organisers, and sponsors who made the Games possible.
President of the Pacific Games Council, the body which oversees the four-yearly gathering, Vidhya Lakhan said: "These Games far exceeded our expectations in terms of the number of athletes participating, the arrangements made, the excellent venues provided, and the very high level of competition."
He said the review of the Games charter, which happens after every event, will include the issue of transgender athletes, after transgender New Zealand weightlifter Laurel Hubbard won gold, prompting much debate in Samoa.
Following protocol, Mr Lakhan officially closed the Games.
During the night, an award for best male athlete of the Games went to Samoan swimmer Brandon Schuster.
The best female athlete of the Games award went to Emma Terebo of New Caledonia, also a swimmer.
There was also an appreciation award given to the prime minister by the council, and the chairman of the Pacific Games Organising Committee, Samoa's Minister for Education, Sports and Culture, Loau Solamalemalo Keneti Sio.
The Pacific Games flag was lowered and handed over to the president of the Samoan Association of Sports and National Olympic Committee, and then to a representative of the Solomon Islands.
The Solomons will host the next edition of the Pacific Games in 2023.
Photo Govt of Samoa