Lance Armstrong reached a $5 million settlement with the federal government in a whistleblower lawsuit that could have sought $100 million in damages from the cyclist who was stripped of his record seven Tour de France victories after admitting he used performance-enhancing drugs throughout much of his career.

The deal announced Thursday came as the two sides prepared for a trial that was scheduled to start May 7 in Washington. Armstrong's former U.S. Postal Service teammate Floyd Landis filed the original lawsuit in 2010 and is eligible for up to 25 percent of the settlement along with attorney fees paid by Armstrong.

Seeking millions it spent sponsoring Armstrong's powerhouse teams, the government joined the lawsuit against Armstrong in 2013 after his televised confession to Oprah Winfrey to using steroids and other performance-enhancing drugs and methods. Armstrong had already retired, but the confession shattered the legacy of one of the most popular sports figures in the world.

In a statement issued through his lawyer, Armstrong said he's happy to have "made peace with the Postal Service.''

"While I believe that their lawsuit against me was meritless and unfair, and while I am spending a lot of money to resolve it, I have since 2013 tried to take full responsibility for my mistakes and inappropriate conduct, and make amends wherever possible,'' he said. "I rode my heart out for the Postal cycling team, and was always especially proud to wear the red, white and blue eagle on my chest when competing in the Tour de France. Those memories are very real and mean a lot to me.''

Lance Armstrong has settled the whistleblower lawsuit brought by the U.S. government for $5 million, less than a month before a scheduled May 7 trial. Former U.S. Postal Service teammate Floyd Landis is eligible for up to 25 percent of the settlement. AP Images/Harpo Studios

Landis told ESPN's Bonnie Ford he was "relieved" that the legal process had ended without going to trial.

"I really didn't want to relive it in a courtroom, and I don't think Lance did either, and I don't know that that would have really accomplished anything," Landis said. "Rather than going through that humiliation again, we're better off. I mean, it was up to Lance, but I think he probably feels the same way.

"He benefited more than everyone else and he's also paid more than everyone else.''

The settlement clears the 46-year-old Armstrong of the most damaging legal issues still facing the cyclist since his downfall. He had already taken huge hits financially, losing all his major sponsors and being forced to pay more than $20 million in damages and settlements in a series of lawsuits. The government's lawsuit would have been the biggest by far.

"No one is above the law," said Chad Readler, acting assistant attorney general for the Justice Department's Civil Division. "This settlement demonstrates that those who cheat the government will be held accountable."

Landis attorney Paul Scott said the settlement, while far less than the potential damages, still holds Armstrong accountable for cheating.

"It's not enough to go on Oprah and say sorry," Scott said. "Our objective was to hold him responsible financially in a very real way and this deal accomplishes that objective."

Scott told Ford whether the lawsuit should have long ago been settled posed "an age-old question," but that he was prepared to go to trial.

"There's nothing like the prospect of the courthouse steps to focus people's attention," he said. "It was typical litigation, in terms of what happens as the prospect of a trial approaches."

Armstrong is still believed to be worth millions based on his vast investment portfolio and homes in Austin, Texas, and Aspen, Colorado. He also owns a pair of bicycle shops in Austin and WeDu, an endurance events company. He also hosts a regular podcast in which he interviews other sports figures and celebrities and has provided running commentary on the Tour de France.

Armstrong had built a worldwide following during his career by winning races and fighting cancer.

His personal story of recovering from testicular cancer that had spread to his brain, while forcefully denying persistent rumors of doping, had built his Lance Armstrong Foundation cancer charity into a $500 million global brand and turned him into a celebrity. The foundation, which removed him from its board and renamed itself Livestrong, has seen donations and revenue plummet since Armstrong's confession.

Armstrong's team was already under the Postal Service sponsorship when he won his first Tour de France in 1999. The media frenzy that followed pushed the agency to sign the team for another five years. Armstrong and his teams dominated cycling's marquee event, winning every year from 1999 to 2005.

Armstrong's cheating was finally uncovered in 2012 when the U.S. Anti-Doping Agency, armed with sworn testimony from Landis and other former teammates, moved to strip Armstrong of his titles.

One of Armstrong's fiercest critics was frustrated by the settlement. Betsy Andreu, whose husband, Frankie, is a former Armstrong teammate, was the first to testify under oath about his performance-enhancing drug use in a 2005 civil lawsuit.

"It's utterly shocking that the government settled for so little," Andreu said.

Andreu and her husband were close with Armstrong when the men were teammates before Andreu retired in 2000. Armstrong later strenuously denied Betsy's claims of drug use and tried to publicly discredit her, which succeeded for years. She wanted the case to go to trial.

"I would have liked to have been questioned under oath. That's my goal. And whether or not the jury would have convicted him would have been a different story, but it would have been nice to have my say under oath. He tried to destroy me," Andreu said.

Landis, himself a former doping cheat who was stripped of his 2006 Tour de France title, sued Armstrong under the federal False Claims Act, alleging Armstrong and his team committed fraud against the government when they cheated while riding under the Postal Service banner. According to court records, the contract paid the team, which was operated by Tailwind Sports Corp., about $32 million from 2000 to 2004. Armstrong got nearly $13.5 million.

Under the lawsuit, the government could have pursued "treble" damages, which could have reached the $100 million range. As the person who filed the original lawsuit, Landis will receive $1.1 million, Scott said. Armstrong will also pay $1.65 million to cover Landis' legal fees.

Armstrong had claimed he didn't owe the Postal Service anything because the agency made far more off the sponsorship than it paid; Armstrong's lawyers introduced internal studies for the agency that calculated benefits in media exposure topping $100 million. The government countered that Armstrong had been "unjustly enriched" through the sponsorship and that the negative fallout from the doping scandal tainted the agency's reputation.

Armstrong had been the target of a federal criminal grand jury, but that case was closed without charges in February 2012. Armstrong had previously tried to settle the Landis whistleblower lawsuit, but those talks broke down before the government announced its intention to join the case.

"I am glad to resolve this case and move forward with my life," Armstrong said. "I'm looking forward to devoting myself to the many great things in my life -- my five kids, my wife, my podcast, several exciting writing and film projects, my work as a cancer survivor, and my passion for sports and competition. There is a lot to look forward to."

Information from The Associated Press was used in this report.