When cyber security magnate John McAfee attempted to run for the White House in 2016, he invoked a Silicon Valley mantra from Steve Jobs in his campaign video, celebrating nonconformists: “Here’s to the crazy ones, the misfits, the rebels, the troublemakers, the round pegs in the square holes.”

McAfee, who was found dead in a Spanish prison cell on Wednesday as a result of an apparent suicide, fitted each of those descriptions — and more.

In his 75 years, the pioneer of his eponymous antivirus software built and lost a fortune, recast himself as a libertarian politician, and then as a cryptocurrency hype man — all while having repeated brushes with the law.

His death came hours after the Spanish high court approved an extradition request from the US, where he faced tax evasion charges. McAfee had been in prison in Barcelona since October, when he was arrested at the request of the US after fleeing America in his yacht, in the final of several high-profile flights from authority.

To many, McAfee’s nomadic life had descended into paranoia, violence and grifting. He had recently been charged with fraud over his involvement in cryptocurrency pump-and-dump schemes, and had been linked by authorities to the murder of a neighbour in 2012. His ramblings on Twitter and YouTube had become increasingly incoherent.

But to the friends and fans to whom he addressed his campaign video, he was an anti-establishment hero — whose fears around technology-enabled government surveillance and financial institutions reflected growing mistrust of authorities today.

“He always dreamt of building an alternative internet that wouldn’t have all the flaws and problems that the current internet has,” said Kim Dotcom, an internet entrepreneur and friend who himself is accused of masterminding one of the largest copyright infringements in history.

In McAfee’s own words, per his Twitter biography, he was an “iconoclast” and a “lover of women, adventure and mystery”.

McAfee was born in 1945 on an army base in the UK to an English mother and an American soldier who was stationed there. Educated in mathematics, McAfee quickly learned to master computing during stints at Nasa, Xerox and Lockheed Martin in the 1970s and 1980s.

He made his name with his antivirus software, which became ubiquitous as computer viruses became an increasingly pervasive security threat. In 1994, he stepped down as chief executive, selling his McAfee stake for a reported $100m, a fortune that he all but lost during the financial crisis.

“Although John McAfee founded the company, he has not been associated with our company in any capacity for over 25 years,” said McAfee, which listed on public markets late last year. “That said, our thoughts go to his family and those close to him.”

Outside of the corporate world, the multimillionaire displayed a penchant for risk. A decade after leaving McAfee, he pioneered a sport called “aerotrekking”, which involved flying microlight aircraft at high speeds over a desert airstrip. When tragedy struck in 2007, and a client of his aerotrekking venture died in an accident at his New Mexico property, he swiftly moved to Belize.

There, he took up residency in a “party palace”, embarking on a playboy lifestyle of drugs, guns and girlfriends. That, too, was not to last: in 2012, his neighbour, US citizen Gregory Faull, was murdered by a gunshot to the head and McAfee was named a “person of interest” in the case. Denying any involvement, he fled to neighbouring Guatemala, where he was later arrested and deported to the US. He was never charged in relation to the murder.

An unapologetic libertarian who reportedly conducted press interviews with a loaded gun in each hand to feel “comfortable”, McAfee also embarked on a quixotic political career. He first announced a White House bid in 2015 with his own newly formed party, the Cyber party, before later — unsuccessfully — seeking the Liberation party nomination in the 2016 race.

“His main mantra in life was freedom,” said Zoltan Istvan, the founder of the Transhumanist party, who met McAfee on the campaign trail in 2015.

“He knew he was being eccentric,” Istvan added, of his public persona. “He liked to be a maverick and he liked the attention . . . But when you sat down to dinner and there were no [journalists] there to cover it, it’s just a real good conversation with a guy who’s incredibly bright.”

McAfee told the Spanish courts last week that his foray in politics came about because he had uncovered corruption in the US tax system, and “considered that only through political action could the tax authorities be rid of [this]”.

A deep mistrust of state surveillance and financial institutions also drew him to the freewheeling world of cryptocurrencies. He was quick to become one of the earliest and most vociferous virtual currency proponents, pledging in 2017 that he would eat his own penis “on national television” if the bitcoin price did not reach $500,000 by mid-2020.

His propensity to talk up cryptocurrency projects on Twitter also caught the attention of regulators. In March, he was charged by US federal prosecutors with fraud. According to the complaint, McAfee selected some small cryptocurrencies — including dogecoin — to promote on the social media platform as “coin of the day” or “coin of the week” in early 2018, buying up them in advance and cashing out once the market surged on his recommendations.

McAfee and others also earned $11m touting several initial coin offerings on Twitter, while failing to publicly disclose that they were being paid for the promotional work, regulators said.

In what was to become his final voyage, McAfee fled the US in 2019 on his yacht after he was indicted by a grand jury for hiding millions of dollars in taxable income between 2016 and 2018. The money was earned, in part, from his promoting cryptocurrencies and selling the rights to his life story, and was concealed by frontmen.

Though he was eventually arrested in Spain in October 2020, he still did not give up the fight. In a Spanish high court hearing last week, he claimed that the US tax charges had “a political motivation”, since he had used his political platform to “denounce corruption” of the US Internal Revenue Service.

But the court rejected his arguments and on Wednesday morning approved an extradition request from the US, and McAfee faced the possibility of the rest of his life behind bars.

He is survived by his wife Janice, a former sex worker who has campaigned for his release under the catchphrase “Free McAfee”.

Even in death, McAfee was remarkable at sparking a media frenzy. For months, he had mythologised a potential departure from the world at the hands of authorities. In one tweet in October, he wrote: “Know that if I hang myself . . . it will be no fault of mine”.

Around the time of his death on Wednesday, a post appeared on his Instagram that simply showed the letter “Q” — an apparent reference to conspiracy cult QAnon, sparking its own wave of conspiracies.

“All power corrupts,” he wrote in his final Twitter message on Friday. “Take care which powers you allow a democracy to wield.”

Additional reporting by Daniel Dombey in Madrid and Richard Waters in San Francisco