Now, just two years after making that decision, Gagnon met up with his bike racer buddies in Lancaster, Mass., to do his very first race, called the Midnight Ride of Cyclocross.

These days, at age 33, Gagnon is 240 pounds slimmer. He is still very big by any standard, but a lot less so. Seeing him, surrounded by svelte, Lycra-clad athletes, squeezed into some spandex of his own, is a little bit jarring at first.

As you watch him, however, you start to get used to the big guy in bike shorts, especially when you realize that Gagnon himself is way past being self-conscious.

"You know, I'm riding in spandex in Boston with these guys. Never thought I could do that, [and] it's liberating in a way," Gagnon says. "It really [forces] you to be honest with yourself, accept who you are; because if you can't accept who you are, you can't do anything."

Before the race, Gagnon goes for a ride around the course with his lieutenant, Catalano, who gives him tips about how to ride it. Gagnon rides along on a custom-built titanium bike that is reinforced to hold his weight.

After checking out the course, he lines up at the start in a crowd of 60 other racers, and after a few nervous, final moments, the race is off.

The racers hurtle along dirt paths and through soccer fields on bikes designed for racing on pavement. There are obstacles in the course, like barriers that they have to jump over, or steep hills they run up with the bikes on their shoulders.

The slender, athletic racers are panting and working hard. For Gagnon, however, it's actually physically dangerous. He has angina, and his doctor told him not to let his heart rate get too high during the race, or he could end up in the hospital — something that has happened before.

Everybody at the race knows about Gagnon, and throughout the race the announcer gives little updates on his progress.

Finally, this hour, the story of one man's remarkable effort to lose weight. Ernest Gagnon, of Billerica, Massachusetts was approaching 600 pounds. He needed more than a diet and regular trips to the gym. He needed a big idea and a community to back him up. Gagnon found both in the slightly oddball sport of cyclocross: racing road bikes on obstacle courses. New Hampshire Public Radio's Sam Evans-Brown has our story.

SAM EVANS-BROWN, BYLINE: So, imagine it's late at night. You're on Facebook and you get a message from someone you've never met asking if you want to go for a bike ride. That's what happened to Cosmo Catalano, a cyclist from Hartford, Connecticut.

COSMO CATALANO: There's like no information about him on his profile. There was just a picture of a bike. It's like, oh yeah, you know, I ride kind of slow. I'm like, yeah, no big deal. Oh, by the way, I'm like, you know, 500-whatever pounds. I'm like, OK, I can deal with that.

EVANS-BROWN: This is how hundreds of New England cyclocross racers met Ernest Gagnon. Two years ago, Gagnon tipped the scales at 570 pounds. He was depressed and embarrassed to leave the house.

ERNEST GAGNON: Being as big as I was, I really felt like I didn't belong anywhere. I was stuck in my house for almost 10 years, you know, just going to work and back.

EVANS-BROWN: Back then, Gagnon's diabetes was getting more serious. He was losing the circulation to his legs and his doctors were talking about gastric bypass surgery. Then, some sort of a switch flipped in his head and Gagnon decided he was going to race bikes, something he'd wanted to do since he was a kid.

(SOUNDBITE OF ANNOUNCER AT CYCLOCROSS RACE)

EVANS-BROWN: Now, two years after making that decision, he meets up with his bike racer buddies in Lancaster, Massachusetts to do his very first race called the Midnight Ride of Cyclocross. Today, at age 33 he's 240 pounds slimmer. Still very big by any standard, but a lot less so. Seeing him surrounded by svelte, lycra-clad athletes squeezed into some spandex of his own is a little bit jarring at first. But, as you watch him, you start to get used to the big guy in bike shorts. Especially when you realize that Gagnon himself is way past being self-conscious.

GAGNON: You know, I mean, I'm riding in spandex in Boston with these guys. Never thought I could do that. It's liberating in a way. But it really makes you - forces you to be honest with yourself, to accept who you are. Because if you can't accept who you are, you can't do anything.

EVANS-BROWN: Before the race, Gagnon goes for a spin around the course with his lieutenant, Cosmo Catalano, giving him tips about how to ride it.

CATALANO: On these areas, just like the ones we did at (unintelligible) earlier this year.

EVANS-BROWN: Gagnon rides along on a custom-built titanium bike reinforced to hold his weight. After checking out the course, he lines up at the start in a crowd of 60 other racers. And after a few nervous final moments, the race is off.

(SOUNDBITE OF WHISTLE BLOWING)

UNIDENTIFIED MAN: Here we go. Good luck, buddy.

EVANS-BROWN: The racers hurtle along dirt paths and through soccer fields on bikes designed for racing on pavement. There are obstacles on the course like barriers they have to jump over and steep hills they run up with the bikes on their shoulders.

UNIDENTIFIED MAN 2: That's it Ernest.

EVANS-BROWN: The slender, ski suit types are panting and working hard. But for Ernest Gagnon, it's actually physically dangerous. He has angina and his doctors told him not to let his heart rate get too high during the race or he could end up in the hospital, which has happened before. Everybody here knows about Gagnon and throughout the race the announcer gives little updates on his progress.

STEVE LACHANCE: I told you you could do it. I told you you could do it. (unintelligible) Do you still want to race bikes?

(LAUGHTER)

EVANS-BROWN: A steady stream of folks Gagnon barely knows, some of the 5,500 Facebook friends who have sought him out after hearing about his story, come by to congratulate him.

UNIDENTIFIED MAN 4: How'd it go, Ernest?

GAGNON: Good.

UNIDENTIFIED MAN 4: Very good. Well, congratulations.

GAGNON: Thank you.

EVANS-BROWN: Gagnon says there isn't a weight goal he's aiming for. He just wants to be healthy. And he's already eyeing a couple more cyclocross races to do this year. For NPR News, I'm Sam Evans-Brown.

(SOUNDBITE OF MUSIC)

AUDIE CORNISH, HOST:

You're listening to ALL THINGS CONSIDERED from NPR News. Transcript provided by NPR, Copyright NPR.