John McAfee, the creator of McAfee antivirus software, was found dead in his jail cell near Barcelona in an apparent suicide Wednesday, hours after a Spanish court approved his extradition to the United States to face tax charges punishable by decades in prison, authorities said.

McAfee who had a history of legal troubles spanning from Tennessee to Central America and to the Caribbean was discovered at the Brians 2 penitentiary in northeastern Spain. Security personnel tried to revive him, but the jail’s medical team finally certified his death, a statement from the regional Catalan government said.

“A judicial delegation has arrived to investigate the causes of death,” it said, adding that “everything points to death by suicide.”

The statement did not identify McAfee by name but said the dead man was a 75-year-old U.S. citizen awaiting extradition to his country. A Catalan government official familiar with the case, who was not authorized to be named in media reports, confirmed to The Associated Press that it was McAfee.

Spain’s National Court on Monday ruled in favour of extraditing McAfee, 75, who had argued in a hearing earlier this month that the charges against him by prosecutors in Tennessee were politically motivated and that he would spend the rest of his life in prison if returned to the U.S.

The court’s ruling was made public on Wednesday and was open for appeal, with any final extradition order also needing to get approval from the Spanish Cabinet.

McAfee was arrested last October at Barcelona’s international airport and had been in jail since then awaiting the outcome of extradition proceedings. The arrest followed charges the same month in Tennessee for evading taxes after failing to report income from promoting crypto currencies while he did consulting work, made speaking engagements and sold the rights to his life story for a documentary. The criminal charges carried a prison sentence of up to 30 years.

Tennessee prosecutors had argued that McAfee owed the U.S. government $4,214,105 in taxes before fines or interests for undeclared income in the five fiscal years from 2014 to 2018, according to a Spanish court document seen by AP. But in this week’s ruling, the National Court judge agreed to extradite him only to face charges from 2016 to 2018.

Born in England’s Gloucestershire in 1945 as John David McAfee, he started McAfee Associates in 1987 and led an eccentric life after selling his stake in the antivirus software company named after him in the early 1990s.

McAfee twice made long-shot runs for the U.S. presidency and was a participant in Libertarian Party presidential debates in 2016. He dabbled in yoga, ultralight aircraft and producing herbal medications.

In 2012 he was wanted for questioning in connection with the death of Gregory Viant Faull, who was shot to death in early November 2012 on the Belize island where the men lived.

A Florida court ordered McAfee in 2019 to pay $25 million to Faull’s estate in a wrongful death claim.

In July of that year he was released from detention in the Dominican Republic after he and five others were suspected of travelling on a yacht carrying high-caliber weapons, ammunition and military-style gear.