Canada finished in 3rd place with a total of 152 medals (35 gold, 64 silver and 53 bronze). That's 65 fewer than four years ago in Toronto, where the country had the best crop in history with 217 medals.
Several Canadian medalists in 2015 were absent this year, including Andre De Grasse, Derek Drouin, Laurence Vincent-Lapointe, Shawnacy Barber, Melissa Bishop and Hugo Barrette.
Here are the highlights for Canada.
Ellie Black, leader of the gymnastics team
Canadian gymnasts stood out in Lima, especially Ellie Black, who had the honor of being named flag bearer for the closing ceremony.
Black won five medals, the same number as in 2015. With a total of 10 medals, she became the most decorated Canadian gymnast in the history of these Games.
The 23-year-old defended his title in the individual competition, as well as on the podium at the jump table (gold), beam (silver) and parallel bars (bronze). She also led teammates Shallon Olsen, Isabela Onyshko, Brooklyn Moors and Victoria Woo in 2nd place in the team event.
At his first Games, Moors impressed by winning gold on the floor.
The men's team, consisting of Zachary Clay, René Cournoyer, Justin Karstadt, Cory Paterson and Sam Zakutney, won the bronze medal.
In the coming weeks, Black and his compatriots will continue their preparations for the World Championships to be held from October 4 to 13 in Stuttgart, Germany. This will be an opportunity for Canada to qualify for the Olympic Games in the team event (women's and men's).
The top nine countries in the standings will get their ticket to Tokyo.
Seven Olympic tickets
In Lima, Canada secured a place in Tokyo for artistic swimming (duet and team), women's water polo, horse riding (team dressage and team jumping), sailing (men's 49er) and archery (male recurve bow).
For the first time in 16 years, Canada's women's water polo team will compete at the Olympics. The representatives of the Montreal Maple Leafs defeated the Brazilians 19-5 in the semifinals and finished the competition with a silver medal after a 24-4 loss to the Americans.
This result was enough to send them to Tokyo, since the United States were already qualified thanks to their FINA World League title.
In Artistic Swimming, Jacqueline Simoneau and Claudia Holzner received gold to secure Canada's place in this event at the 2020 Games. Simoneau, with Karine Thomas as a partner, finished 7th in the Rio duet in 2016.
With their teammates, Simoneau and Holzner also easily won the team event. They have at the same time offered a place for their country for Tokyo, three years after missing the rendezvous in Rio.
Records in athletics
Canada stood out with 15 medals in athletics, including 5 gold.
Acadian Genevieve Lalonde triumphed in the 3000m steeplechase setting a record for the Pan American Games. His compatriots Marco Arop (800m) and Natasha Wodak (10,000m) made the same double blow.
Lalonde ran the distance in 9:41:45/100, 12 seconds faster than in 2015 when she won bronze.
For his part, Arop stopped the clock at 1: 44.25, the best result of his career. It was a first experience at the Pan Am Games for the 20 year old athlete.
Seventh four years ago, Natasha Wodak crossed the finish line in 31: 55.17 to break the record that had belonged since 2015 to the Mexican Branda Flores (32: 41.33). The other Canadian in the final, Rachel Cliff (32: 13.34), took the third step of the podium.
Ontarian Damian Warner remains the king of the decathlon. Champion in 2015 with 8659 points, this time he got a score of 8513. Warner became the first athlete to defend his Pan American title in this competition.
Her compatriot Pierce LePage, Commonwealth runner-up, was third at 8161 points.
In the shot put, Britanny Crew, who was competing in her first Pan American Games, took silver by setting a Canadian record of 19.07 meters. It held the old mark of 18.69 meters.
Two other podiums in rugby
The Canadian players defended their 2015 title in rugby 7, after again defeating the Americans in the final, this time by the score of 24-10.
The Canadians had secured their ticket for the 2020 Olympics last June, ranking among the top four nations in the World Series final standings.
On the men's side, Argentina took their revenge on Canada in the final. Canadians had to settle for money after their 33-10 loss.
Last July, the Canadians qualified for Tokyo by winning the North American 7-a-side rugby championship.
Four times diving gold
The Canadian divers again impressed with five medals, including four gold medals.
For the second time in her career, Quebec's Jennifer Abel was crowned 3m champion. She had the same success in 2015.
Abel also took the gold medal in the 3m synchronized with fellow countryman Pamela Ware. The two athletes had not competed together since 2016.
Meaghan Benfeito also left Lima with two titles in the 10m individual and synchronized (with Caeli McKay). In 2015, Benfeito was on the third step of the podium.
At his first Games, McKay collected the money in the individual event.
On the men's side, Philippe Gagné received the bronze in 3 m, and distinguished himself with a 2nd place duet with François Imbeau-Dulac.
In 10 m, Vincent Riendeau and Nathan Zsombor-Murray got their hands on the money. Riendeau was also a bronze medalist in the individual event.
The Pan American Games of 2023 will be held in Santiago, Chile.