Lance Armstrong during a 2011 interview. He settled with the federal government on Thursday. (Thao Nguyen/AP)

When Lance Armstrong’s world came crashing down, perhaps no one wanted to get further away from the brash cycling icon faster than Armstrong himself.

He vividly remembers sitting with his girlfriend, Anna Hansen, and feeling the tremors. “We’re looking at each other going, ‘Oh my god,’ and it’s getting worse and worse. I told her, ‘I need to become Lance Hansen as soon as possible,’ ” Armstrong said in a 2016 interview with The Washington Post, suggesting he adopt his longtime girlfriend’s last name.

“To me, that’s going away — going dark forever, becoming some random guy.”

In many ways, Armstrong has gone dark since his spectacular fall from grace, only recently poking his head out publicly. He was once recognizable worldwide for battling cancer, for beating cancer, for a wildly successful charity, for winning seven Tour de France titles, for losing seven Tour de France titles, for years of suspicion and doping and lying and for his 2013 confession to Oprah Winfrey.

For Armstrong, Thursday’s news that he struck a deal with the federal government staving off trial marks the culmination of a topsy-turvy tale, in which Armstrong was both hero and villain, adored and detested. He’d been accused of defrauding the U.S. government after using performance-enhancing drugs while competing under the U.S. Postal Service banner. Less than a month before trial, he settled and agreed to pay back $5 million to the government and $1.65 million to cover the legal costs of a former teammate.

The resolution could have been much costlier for Armstrong, who could have been on the hook for as much as $100 million if a jury eventually sided with the government. The case started as a whistleblower lawsuit, filed in 2010 by former teammate Floyd Landis; the U.S. government joined it in 2013 following Armstrong’s confession.

Armstrong has long maintained that the government suffered no damage because the marketing and visibility his career provided USPS was more valuable than the sponsorship money he received, which was estimated in court filings at $32 million.

For Armstrong, Thursday’s settlement marks a chance to finally move forward, stepping away from financial fears and deciding what his post-cycling life and post-Livestrong societal contribution might really look like. Time will tell just what, if anything, is salvageable from his tainted legacy.

“I am glad to resolve this case and move forward with my life,” Armstrong said in a statement Thursday. “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.”

He’d been making baby steps for the past year and a half, staging racing events, hosting that podcast, engaging on social media. But he largely stayed out of public eye in the months and years that followed his admission — intentionally at times, regrettably at others.

“I’m still in timeout,” he told The Post in an October 2016 interview at his house in Austin.

All the while, the federal lawsuit hung over his head like a scythe. It threatened his post-cycling career, his fortune, his home, his family. To say it weighed heavily on him would be an understatement.

“If it goes the wrong way for us, we’re on the street,” he said. “Let’s hope it doesn’t go the wrong way.”

Armstrong was always proud to a fault and no doubt spent years trying to piece together the shards of his shattered ego. He’d lost his Livestrong charity, his athletic career and his reputation. But the lawsuit presented a threat that was more visceral, more perilous to his livelihood.

For many people, the dark shadow of the scandal will follow Armstrong forever. He has no illusions about that. And even for him there have been times he thought he had no chance to shake free. The looming lawsuit was a constant companion and a persistent reminder.

“Anna will tell you, for four years, all I did was play golf and goof off,” he said. “She’s like, ‘What the [expletive] are you doing?’”

Armstrong, now 46, eventually dusted himself off and has slowly been plotting a course forward. He’s working on a sports-endurance brand he calls WEDU. Though a formal launch isn’t expected until later this year, the company has already staged endurance rides in Texas and Aspen, Colo., and sells hats and shirts on its website. It eventually could encompass training, a charitable arm and more original content, like the two podcasts Armstrong hosts. He’s more than 18 months into an interview-based podcast that has featured an eclectic range of guests, such as Rahm Emanuel, Bo Jackson, Neil deGrasse Tyson, Brett Favre and Lyle Lovett. It’s called The Forward, and the symbolism isn’t meant to be subtle.

“If I thought about my life, at this point, I just have to move forward,” Armstrong said in 2016. “A new business has to move forward; the conversation has to move forward. Everybody knows what happened. There’s no need, I don’t think, to go back over that again. It is forward.”

The exact goal of WEDU — and Armstrong’s next chapter — is a bit nebulous, but that could be by design. “We’re not trying to build the next Google, Apple or Microsoft,” he said.

It has been a slow rollout, and in theory, if he launched the company and went from 0 to 100 mph with it right away, all that revenue could’ve been essentially earmarked for the federal government. In fact, his podcast has featured a long list of big name guests but no advertisers, which was not accidental.

“At some point there will be advertising,” he said in 2016, “but it’s going to be longer than you think.”

That point could be getting closer. Armstrong has recently started working with a New York-based publicist for his podcast, and other parts of his life are also nearing a transition. He became engaged last year to Hansen, the mother of his two youngest children. He has five kids in all. The oldest, Luke, agreed earlier this month to join Rice’s football team as a walk-on offensive lineman.

“So incredibly proud of my son and the young man he’s become,” Armstrong posted on Instagram. “He’s a great friend, teammate and brother to his 4 siblings. I canNOT wait for the next chapter.”

And last month, Armstrong put his Austin home on the market for $7.5 million. The house is 8,000 square feet and has six bedrooms. There’s a swimming pool, a wine cellar, eclectic art filling the walls and old Italian cypress trees creating a canopy of shade over the back yard.

Asked at that house in 2016 if he felt retired on some level, he said: “Retired? It doesn’t feel like that. This story is not like most athletes. This was a fall. I was forced to retire — how do you describe it? — I was told, ‘You’re retired.’ ”

And he’s been waiting more than five years now to start over, something he couldn’t really do in earnest until the federal lawsuit was behind him.

Read more from The Post:

To replace Gregg Popovich, Spurs turn to Ettore Messina, ‘one of the best coaches in the world’