LIMA, Peru — Gymnast Ellie Black will serve as Canadian flag-bearer at the closing ceremony of the Pan Am Games.

Black, who won five medals in Lima, will carry the Maple Leaf into Peru's National Stadium on Sunday night.

"It means so much to have this opportunity to hold our Canadian flag high and proud," Black said. "The Canadian athletes’ performances were inspiring and so exciting to follow while in Lima and back at home.

"I'm very proud of everything we were able to achieve and I am so excited to lead this amazing team as we march into the stadium."

Black won two gold medals, two silver and one bronze at the Villa El Salvador Sports Center to become Canada's most decorated Pan Am gymnast.

"Ellie is a super role model, a team leader and an inspiration for the next generation of gymnasts," said Canadian Olympic Committee president Tricia Smith.

Black competed early in the Games before returning home to Halifax to continue training for the world championship this fall. Canadian chef de mission Douglas Vandor phoned Black to give her the news of her selection.

On Sunday morning, Canada was third overall with 148 medals (33 gold, 64 silver and 51 bronze). The United States led with 281 medals (114-86-81) and Brazil was next with 164 (54-42-68).

Several events were scheduled to be completed later in the day.

The 23-year-old Black also won five medals at the 2015 Pan Ams in Toronto.

"For me, this is so exciting for Canadian sport and Canadian gymnastics," Black said. "To have great results and make history for my country, but most importantly inspiring others to dream big, go for your goals, and break down barriers. It’s special to share these results with my whole team."

Black became Canada's first all-around medallist at a world championship when she finished second at the 2017 event in Montreal. She won her sixth all-around national title earlier this year.

Field hockey player Scott Tupper served as Canadian flag-bearer at the opening ceremony.

The Pan Ams are the largest sporting event ever held in Peru. The Parapan Am Games are set for Aug. 23-Sept. 1.

The 2023 Pan Am Games will be held in Santiago, Chile.