07/17/2015 08:16 EDT | Updated 07/17/2016 05:59 EDT

Emily Overholt recovers from DQ to win gold

Disqualified a night earlier after an apparent gold-medal victory, Canadian swimmer Emily Overholt recovered Friday night to win the women's 400-metre freestyle at the Pan Am Games.

The 17-year-old won the 400 free final from lane eight in a Pan Am -ecord time 4:08.42 a day after losing her gold medal in the women's 400m individual medley. She was disqualified for a non-simultaneous touch in that race.

Overholt outdueled Venezuela's Andreina Pinto in a very close finish, beating her to the wall buy a mere 0.25 of a second to earn her third medal of the Games. 

Overholt struggled in the morning, barely qualifying for the final in the eighth position, but stormed out at the beginning in the final, leading from wire to wire.

Gilian Ryan of the U.S. won the bronze.

Canada now has six gold in swimming and 20 medals.