American swimmer Katie Ledecky put on a show at the world championships on Saturday, with a win in the 800-meter freestyle over Italian swimmer Simona Quadarella. 

Ledecky had to sit out of Tuesday's 1500-meter freestyle final due to an illness, an event where Quadrella ended up taking gold. Ledecky also withdrew from the 200-meter freestyle for the same reason, citing her symptoms as  insomnia, an elevated heart rate, headaches and an inability to keep food down.

Powering through the illness, Ledecky decided to get back in the pool for her signature event, the 800-meter free, though she said she thought about withdrawing "for about a minute." What seemed to be a bust of a world championship for the 22-year-old ended up with her at the top of the podium. 

Ledecky started off strong in Saturday's 800-meter event, leading by 1.14 seconds after 200 meters but lost the lead to Quadarella after 450 meters. At the 600 meter mark Quadarella was ahead by 0.84 seconds, and gold seemed nearly out of reach for Ledecky. 

Ledecky narrowed the gap to 0.55 seconds at 650 meters and quickly after brought it down to 0.12 seconds. Swimming the final 50 meters in 29.19 seconds, Ledecky finished first with a time of 8:13.58, 1.14 seconds ahead of the second place swimmer. 

"Knowing that I can pull out the last 50m like that, I kind of knew I had a little more speed than Simona and kind of just trusted that I could rely on that at the end," she said.

"Just kind of relieved to end on a good note," Ledecky said. "Not a good time, but I just gutted it out. It was a tough week for me physically, mentally, emotionally and all of it, but I had great support from my friends, family, coaches and medical staff. Never imagined I'd have this kind of week. I'm excited for the next year of work."

Ledecky said she had her best training of her three years at Stanford going into this year's worlds and was anxious to have something to show for it. 

Earlier in the week Ledecky was upset by Australia's Ariarne Titmus in the 400-meter freestyle, breaking her world championship win streak going back to 2013 and earned a silver medal in the 4x200m freestyle relay. 

She says this world championships story is one she will be "telling for a while."