PARIS - Spain's men added their first Olympic soccer gold medal in 32 years to their glittering trophy cabinet, while the US women's team won a record-extending fifth title and their first since London 2012 before packed crowds at the Paris Games.
Coming off European Championship success for their men's senior and under-19 teams, Spain's under-23 side capped a golden summer by winning the title in an epic clash with hosts France that they won 5-3 after extra time at Parc des Princes.
The triumph earned Spain a first Olympic soccer gold since the 1992 Barcelona Games and first in a team sport in 28 years.
"We had a dream, this gold is the best that an athlete can aspire to," coach Santi Denia said. "An Olympic gold is the greatest, you can see how beautiful it is and the tears it brings."
Despite failing to end France's 40-year Olympic title drought, coach Thierry Henry said he was proud of their silver medal.
Morocco won bronze after crushing Egypt 6-0 to earn the country's first-ever medal in a team sport.
ALSO READ: Soccer: Camello double gives Spain gold with 5-3 extra-time win over France
The women's competition began with a drone spying scandal that marred Canada's campaign, with the team handed a six-point deduction and coach Bev Priestman banned for a year by FIFA.
The Tokyo gold medallists still reached the knockout stage, but lost to Germany in the quarter-finals in a tournament that the unbeaten US women largely dominated.
The Americans beat Brazil 1-0 in the final to earn their third victory over the South Americans in a gold medal decider.
US coach Emma Hayes only took the job in May but lived up to expectations, with her team claiming extra time wins over Japan and Germany in earlier rounds.
"It was a perfect storm, in the perfect timing. Winning is in my DNA and so it is in the US national team's," former Chelsea coach Hayes said after the final.
Brazil were unable to give a fitting farewell to leading scorer and six-times Olympian Marta, who will retire from international football this year.
Yet they had a remarkable tournament, reaching the knockout stage as one of the second-best third-placed sides, before beating hosts France in the quarters and Spain in the semis.
READ MORE: Soccer: US reach first Olympic final in 12 years with 1-0 extra-time win over Germany
World champions Spain's medal hopes were ended by Germany in the third-place match. The Germans dedicated their fourth bronze to coach Horst Hrubesch, who left his role after the tournament.