The ambition to ride ultralong distances by mountain bike came to Bonnie Gagnon of Lakeville at a time when it seemed a distant possibility. Bedridden for weeks in the hospital with a life-threatening bacterial infection eating away at her insides, visions of rebuilding a healthy and active body were at the forefront of her mind.

It was 2010. Gagnon, a mother of four and a medical benefits specialist, had been in and out of doctors' offices with pneumonia-like symptoms. It wasn't until she began coughing up handfuls of blood that doctors recognized her illness as Lemierre's syndrome, a rare and aggressive bacterial infection that started in her lungs and spread to her back and beyond.

In addition to blood transfusions and countless rounds of antibiotics, she required a series of surgeries. Her appendix was removed. And she had a full hysterectomy. Vexed by her condition, doctors didn't know if she'd survive.

After an improbable recovery, Gagnon, 48, said she was told: "Whatever it is you want to go do with your life, do that thing, because we don't know if we've actually cured you and we'll only know if we haven't because you'll likely die."

Gagnon's response: "Let's do this."

By that she meant getting back in the saddle, literally and figuratively. It started with short bike rides and progressed to 100-plus-mile grueling mountain bike races everywhere from the mountains of Colorado to the ice-laden trails of northern Minnesota. Last week she set off for her biggest challenge yet: A 2,745-mile, self-supported mountain bike race from Banff, Alberta, to the Mexican border. The race is called the Tour Divide.

Before her departure, Gagnon spoke about life, cycling, and the importance of never giving up even when the odds are stacked against you.

On finding the motivation to survive through cycling

When I was diagnosed with Lemierre's syndrome I was very far into the disease, to the point doctors didn't think I would live. They admitted me to the ICU and started trying to heal me. While I was in the hospital I was thinking about all the things that meant so much to me. Of course you have family, God, your faith, but one of the other things that is important to me is being able to ride a bicycle, because for me, riding a bike is this incredible opportunity to express yourself. It's freedom and self-propulsion, and you have access to things you would never see if you weren't out there.

On her first time back on a bike

It was after I left the hospital and on that first ride I thought, 'This is the scariest thing I've ever done.' I can get on a road bike and feel pretty confident, but I got on that dirt track with trees and different surfaces and obstacles, and it was pretty terrifying. To be honest, I hated it, but I came back the next day and did it again and kept coming back until I mastered those basic skills I needed to have confidence to be able to enjoy something like that. If there's one thing I've learned in life, it is that you can't let your fear control who you are or let it mitigate your success. So I kept coming back to take on what I feared, which was getting hurt on a mountain bike, because I knew it was also something I would eventually love and that was more important than the fear of it.

On learning what her body is capable of

When I came out of the hospital I was 24 pounds lighter than I had been just a couple weeks prior because the bacteria ate through my body and I was on IV fluids only. It was quite devastating. The hardest part of this journey has been continuing to train, but not seeing the same results as I would have seen before I was sick. I no longer have a uterus, a cervix or ovaries, and I don't produce the same types of chemicals and hormones that I did before, so my body doesn't have the same response to training. I also have diminished lung capacity from the permanent scarring of my lungs, so I have a lot harder time breathing when I'm training and racing. It slows me down and is humbling, but I still have this gratitude for having survived, and feel so much awe when I look at my body and see it perform. That completely outweighs the frustration.

On challenging herself

When I did the Arrowhead 135 in International Falls in 2013, it was the year they had a huge snowstorm. During the night we had 10 inches of snow dumped on us. If you talk to anyone who knows me, even during that night when all the snow was falling and we were pushing our bikes through it, I was smiling. I smile during the most brutal races because I realize that I get to do these things and that means so much to me.

On her motivation to ride the Tour Divide

It's off-road, you ride through massive amounts of forestry, you go through desert areas, there is all this beautiful and amazing terrain, and you cross over the Continental Divide about 31 times. Those are some of the biggest reasons why I ride. I love all those things — the beauty of it, the aromas coming from the forest. And this will be 28 days of that.

On training in Minnesota

It's tough training here for something like this — it's beautiful but not mountainous. A lot of times it's a matter of adjusting gearing to correlate more appropriately with what would be considered climbing, whether that's pushing harder gears or an easier gear for a longer period of time. There's also the bike packing piece for this event, so I have to carry my gear and camp overnight off my bike. I've done many century rides or more where I bike 100 miles, sleep in my tent, pack back up, and repeat that over the course of a couple of nights during the weekend since I work full time during the week. I ride down at Afton (State Park) a lot, and there's a hill in St. Paul I train on. I try to go someplace new every weekend, whether that's riding to Otsego or Stillwater or Wisconsin.

On where her mind goes during the hours of solitude

There are a couple mental tactics I use. One of them is gratitude. When I break down all the things I have to be grateful for, I will be thinking about those things for hours because there is so much. There's my children, times they have made me smile or laugh, there's the birds, and my beautiful surroundings. I never want to overlook my surroundings when I'm on my bike. It's easy to turn your eyes inward to your struggle, so appreciating what's around me puts my mind in the right place.

Mackenzie Lobby Havey is freelance writer from Minneapolis.