(CNN) Cycling legend Lance Armstrong will pay the United States $5 million for using performance-enhancing drugs while the US Postal Service was paying millions to sponsor his team, according to the US Department of Justice.

The lawsuit accused Armstrong of violating his contract with the US Postal Service and committing fraud by misleading the USPS and the public when he denied using performance-enhancing drugs, known as PEDs, according to the release from the Justice Department.

Armstrong's denial influenced the USPS decision to continue sponsoring the team in 2000, the Justice Department said. The decision to do that increased fees for the sponsorship, the release said, and increased the money going into Armstrong's pocket.

Between 2001 and 2004, the Postal Service paid $31 million in sponsorship fees to Armstrong's team.

"No one is above the law," Chad Readler, acting assistant attorney general for the Justice Department's Civil Division, said in a news release. "A competitor who intentionally uses illegal PEDs not only deceives fellow competitors and fans, but also sponsors, who help make sporting competitions possible. This settlement demonstrates that those who cheat the government will be held accountable."

Read More