John McAfee of antivirus software fame and his entourage were detained for several days in the Dominican Republic after authorities discovered firearms and ammo on his yacht, according to reports.

The eponymous founder of the PC software security giant docked his yacht, Great Mystery, in Puerto Plata, where the stash was seized, Reuters reported.

On Wednesday, McAfee, 73, said on Twitter that he was released “after four days of confinement” along with five other people, including his wife Janice.

“I was well treated. My superiors were friendly and helpful. In spite of the helpful circumstances, we’ve decided to move on,” the British-born millionaire said in a tweet.

He also retweeted a photo posted by his wife of himself sitting shirtless in a jail cell.

“@theemrsmcafee insisted I looked better in this jailhouse photo since I was smiling. Janice was incarcerated in the cellblock next door at the same time. She just forgot how to properly smuggle phones,” he wrote.

McAfee, who is being sought by tax authorities in the US, recently told Reuters that he could help Cuba evade the American government too — by launching a cryptocurrency that defeats a US trade embargo.

On July 19, he noted that he is a presidential candidate with 1.2 million followers.

“My crime is not filing tax returns – not a crime. The rest is propaganda by the U.S. government to silence me. My voice is the voice of dissent. If I am silenced, dissent itself will be next,” he wrote.

“The CIA has attempted to collect us. We are at sea now and will report more soon. I will continue to be dark for the next few days,” he said in another tweet, which included a photograph of himself and a woman brandishing rifles.

On July 22, he tweeted that they had been “at sea 4 and a half in rough weather. Nearing port. All is well. Will be back in the saddle shortly.”

McAfee said he couldn’t wait to “get off of this God forsaken boat that lost air conditioning and water 18 hours into the trip. None of us have bathed for 5 days.”

His Twitter account was later taken over by his campaign manager Rob Benedicto Pacifico Juan Maria Loggia-Ramirez, who wrote: “if John misses his next check-in, events will be set into motion that I cannot prevent once they have begun.

“John has secreted data with individuals across the world. I know neither their identities or locations. They will release their payloads if John goes missing.”

McAfee previously fled from Belize, where he had lived for several years after authorities sought him for questioning in the 2012 murder of a neighbor.

He met his wife when she solicited him as a prostitute while he was on the lam. Last year, he said on Twitter that he had fathered 47 children.