When former Tour de France cyclist Tyler Hamilton was caught using performance-enhancing drugs in 2010, he thought it was the worst day of his life. But looking back, Hamilton said he now regards it as the best.

Hamilton — a teammate of Lance Armstrong and a 2004 Olympic gold medal winner — spoke in William L. Harkness Hall on Tuesday night to an audience of roughly 20 during Dominik Pesta’s “Performance and Performance-Enhancing Substances” seminar. Drawing on his own experiences, Hamilton offered insights on the meaning of being a professional athlete, the pressures involved in professional cycling, his eventual descent into doping practices and his work to expose Lance Armstrong.

Hamilton said he began doping in the spring of 1997 and rode his first Tour de France later that year.

“About two and a half years into my professional career, my doctor told me that I needed to take this little red testosterone pill for health reasons,” he said. “I swallowed it, and little did I know that this was going to be the start of a huge doping program in my career.”

Hamilton said he was not the only one on the tour partaking in these illegal practices. Around 200 other riders on the tour were doping as well, he said. He described the culture of cycling during this time period as “nasty,” because cyclists felt pressure to dope and doping controls were virtually nonexistent.

Hamilton said doping practices were always just below the surface, and there were many people devoted to keeping this aspect of professional cycling a complete secret.

Although Hamilton said he knew what he was doing was wrong, he chose to look the other way, using the excuse that his fellow professional cyclists were doping as well.

With the help of doping practices, Hamilton’s career flourished, and he went on to win several stages in the Tour de France. In 2004, he won a gold medal at the Summer Olympics in Athens — a medal he voluntarily gave back in 2012.

“I became a person I never wanted to be,” Hamilton said. “I became more concerned about getting caught than winning. But I eventually felt better about giving my gold medal back than I did about winning it.”

In September 2004, after doping for roughly eight years, Hamilton tested positive during doping tests. While Hamilton said he knew this was the perfect opportunity for him to finally tell the truth about what he had been doing, he said he feared he would be banned from the sport. He also knew that telling the truth would require him to out his entire team.

After his career was over in 2010, Hamilton was subpoenaed to appear before a jury during the investigation of Lance Armstrong and admit to doping. This was the turning point of his life, he said. Prior to this, he had been denying his practices and thinking that he would have to live with his secrets forever, he said.

After admitting the truth to the jury, Hamilton decided to go on “60 Minutes” and tell his story on national television. He then spent two and a half years writing a book about his experiences.

“I did eight Tour de Frances, and writing the book was harder than all eight combined,” he said.

During his talk, Hamilton answered various questions from students in the seminar about the effects of doping on his health, his family life and his social life.

When asked if he would be a proponent of legalizing performance enhancing-drugs in cycling to level the playing field between competitors, Hamilton was adamantly against the idea. Everyone’s body is different and reacts differently to doping, he said, so legalizing the practice would not level the playing field, he said.

Now that he has publicly admitted to his wrongs, Hamilton said it is his goal to reach out to as many people as possible and help them learn from his mistakes. Although he is proud of his book, Hamilton said he can never be proud of the things that he wrote about having done.

“It’s never too late to tell the truth,” he said. “People will forgive. People appreciate honesty.”

Students interviewed after Hamilton’s talk said they were inspired by his message and thrilled to be in such a close setting with an athlete who has been all over the national news.

Arlana Agiliga ’16 said she has read many articles for the “Performance and Performance-Enhancing Substances” seminar about athletes like Lance Armstrong and Tyler Hamilton. This was an opportunity to hear directly from someone who had competed at the highest level of cycling.

“It was very exciting to have someone who was at the center of such controversy and who’s really shaping things in the real world come to our class,” said Dhruv Aggarwal ’16, a former staff reporter for the News. “Generally at Yale we invite speakers who are shaping different types of issues, like safety issues and political issues, but it was interesting hearing from someone who’s been so critical in shaping a sports issue.”

Tyler Hamilton’s book, “The Secret Race: Inside the Hidden World of the Tour de France: Doping, Cover-ups, and Winning At All Costs,” was published in 2012.