Media playback is unsupported on your device Media caption Armstrong defiant in 2009: "I know what I did and did not do. I sleep at night."

To his millions of fans, American cyclist and cancer survivor Lance Armstrong was more than just a great sportsman, he was an inspiration. To the film-maker who documented his spectacular fall from grace, he was a master storyteller. But were his supporters too ready to believe the fairytale?

The story of the charismatic Texan cyclist who recovered from life-threatening cancer and went on to win the Tour de France a record seven successive times was one of the greatest tales in sporting history.

In 2009, Lance Armstrong attempted to write another chapter into the legend by coming out of professional retirement to compete in the Tour again at the age of 37. He granted Oscar-winning filmmaker Alex Gibney rare access to his inner circle to chronicle the comeback.

For Gibney, the experience was akin to being embedded with the military in a warzone.

"When you're with a group of soldiers in Iraq or Afghanistan you're going to end up feeling part of their unit," he told me.

"I don't think that's necessarily wrong. The trick is how to come out of that with some broader perspective - but it's intoxicating while you're in the middle of it."

Gibney admits the "them and us" mentality inside Lance Armstrong's Astana cycling team encouraged a kind of Stockholm syndrome. Anyone who questioned his repeated denials that he had used performance-enhancing drugs came to be viewed as the enemy.

"I did begin to feel that some people on the outside were a bit fanatical about the subject of whether Lance had doped," he says. "You can't help but take on the vibe of the team."

Through the media and in the courts, Armstrong aggressively pursued critics who continued to question whether he was riding clean. Alex Gibney watched as his subject attempted to maintain control over the powerful and lucrative myth he had constructed.

"I think the truth in the mind of someone who is a master storyteller does become elastic," he suggests.

"There's a moment in the film when Lance loses in Verbier to Alberto Contador (on stage 15 of the 2009 Tour de France) and he says to me 'I'm sorry I screwed up your documentary.'

"I don't think that was just banter. I think that was Lance's way of saying 'you came to me to deliver the fairytale that everyone's come to believe that I can deliver and I failed. I'm not going to win. I'm not going to be first and I'm sorry.'"

Image caption Armstrong behind eventual 2009 Tour winner Alberto Contador

After Armstrong's 2009 comeback, in which he finished third, the myth began to disintegrate.

The cycling career Tour de France victories: 1999, 2000, 2001, 2002, 2003, 2004, 2005 (22 individual stage wins)

1999, 2000, 2001, 2002, 2003, 2004, 2005 (22 individual stage wins) Cancer: Diagnosed with testicular cancer in 1996. The disease spreads through his body. Launches Lance Armstrong Foundation for Cancer. Declared cancer-free in 1997 after brain surgery and chemotherapy

Diagnosed with testicular cancer in 1996. The disease spreads through his body. Launches Lance Armstrong Foundation for Cancer. Declared cancer-free in 1997 after brain surgery and chemotherapy Retirement: Announces he will retire after the 2005 Tour de France. Angered by drug allegations against him, he returns to professional cycling in 2009. He finishes third. His accident-filled 2010 Tour is his last

Announces he will retire after the 2005 Tour de France. Angered by drug allegations against him, he returns to professional cycling in 2009. He finishes third. His accident-filled 2010 Tour is his last Lifetime ban: Stripped of his seven Tour titles and banned from professional sport for life in 2012

Former teammates went public with allegations of drug use. The US Anti-Doping Agency accused Armstrong of running the most sophisticated and extensive doping scheme in professional sports history.

He finally came clean in an interview with talk show host Oprah Winfrey last January, in which he admitted taking banned substances and undergoing prohibited blood transfusions during all of his victorious Tour de France campaigns.

In earlier films such as Enron: The Smartest Guys in the Room, Taxi to the Dark Side and Mea Maxima Culpa, Alex Gibney has explored the abuse of power by big businesses, the military and the Catholic Church.

In his latest film, it's Armstrong's rewriting of his own personal life story, a story that inspired and gave hope to cancer patients around the world, that Gibney finds particularly difficult to accept.

"It's an abuse of storytelling power," he says. "He told a story that everyone wanted to believe in too much. He knew how much everybody wanted to believe in it.

"He made the lie so enormous, so all-encompassing, that he couldn't dial it back. His only choice was to go forward and make it even bigger." So he carried on cheating, winning Tour after Tour.

Image caption Armstrong was engaged to musician Sheryl Crow and travelled by private jet

Stripped of those seven titles, pursued by lawyers seeking to reclaim prize and sponsorship money, Lance Armstrong's reputation as a sportsman is now in ruins. He has been banned from competitive cycling for life.

For Alex Gibney, Lance Armstrong's epic downfall should serve as a cautionary tale. Even heroes, he argues, need to accept their flaws. "There can be inspirational stories that are messy," he says.

Media playback is unsupported on your device Media caption Alex Gibney: He looks you in the eye and says 'This is the truth'

"Spiderman to me is a more intriguing tale than Superman because you reckon with Peter Parker's dark past and to some extent his deep-seated anger rather than the pure hero that Superman is.

"When we're told stories that seem too good to be true we should say to ourselves, 'Hey, maybe this is too good to be true.'"

Follow @BBCNewsMagazine on Twitter and on Facebook