Lance Armstrong has reached a $US5 million settlement with the federal government in a whistleblower lawsuit that could have sought $US100 million in damages from the cyclist.
Armstrong 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 on Thursday came as the two sides prepared for a trial that was scheduled to start May 7 in Washington.
Armstrong's former US Postal Service teammate Floyd Landis filed the original lawsuit in 2010 and is eligible for up to 25 per cent of the settlement.
Seeking millions spent sponsoring Armstrong's powerhouse teams, the government joined the lawsuit against Armstrong in 2013 after his televised confession 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 to The Associated Press, 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."
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 $US20 million in damages and settlements in a series of lawsuits.
The government's lawsuit would have been the biggest by far.
Armstrong is still believed to be worth millions based on a 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.
THE RISE AND FALL OF LANCE ARMSTRONG
1991: Armstrong is the US amateur national champion at the age of 20.
1992: Turns pro and finishes last in his debut race in San Sebastian, Spain.
1993: Wins world championship. Enters his first Tour de France, where he wins a stage but drops out and doesn't finish.
1995: Wins another Tour de France stage and finishes the race for the first time, in 36th place.
1996: Diagnosed with testicular cancer that has spread to his lymph nodes, lungs, brain and abdomen. Treatment includes chemotherapy, brain surgery and removal of a testicle.
1999: Wins first of seven consecutive Tour de France titles at age 27 and is almost immediately forced to defend against questions about doping, which he strongly denies. He tests positive for a corticosteroid but is allowed to show a back-dated prescription to avoid sanctions.
2000: Wins second Tour de France and a bronze medal at the Sydney Olympic Games.
2002: Wins fourth consecutive Tour de France. A two-year investigation into whether the US Postal Service team used performance-enhancing drugs in 2000 ends without finding any evidence.
2004: Wins record-setting sixth Tour de France.
2005: Wins seventh Tour de France and retires from cycling at age 33. French newspaper L'Equipe reports blood samples retested from 1999 race show EPO use that year. Armstrong denies the allegations.
2009: Comes out of retirement and finishes third in the Tour de France.
2010: Former Armstrong teammate Floyd Landis, who was stripped of the 2006 Tour de France title for doping, alleges Armstrong and the US Postal team engaged in years of sophisticated performance-enhancing drug use. Landis files federal whistle-blower lawsuit.
2011: Armstrong again retires from cycling at age 39.
2012: A federal criminal investigation into doping includes interviews of witnesses close to Armstrong but closes without charges. The US Anti-Doping Agency then charges Armstrong with cheating. Armstrong denies doping, but chooses not to fight the charges, prompting USADA to issue a lifetime ban on competition.
2013: Armstrong admits years of performance-enhancing drug use to Oprah Winfrey in a televised interview. The federal government joins the Landis lawsuit and says it intends to seek damages up to $100 million for breach of contract for cheating while racing under the US Postal Service sponsorship.
2015: Armstrong is forced to pay $US10 million in a fraud dispute with a promotions company that first sought to prove doping allegations in 2005. It is one of several legal cases that will cost Armstrong more than $US20 million.
2018: Armstrong settles the whistleblower lawsuit for $US5 million less than a month before a schedule May 7 trial.