McAfee, who had been in hiding for three weeks, crossed into Guatemala with his 20-year-old girlfriend to evade authorities in Belize who wanted to quiz him as "a person of interest" about the killing of fellow American Gregory Faull.
"He entered the country illegally and we are going to seek his expulsion for this crime," Interior Minister Mauricio Lopez Bonilla said. McAfee was detained by Guatemalan police and a member of Interpol at the upscale Intercontinental hotel in Guatemala City.
One of Silicon Valley's first entrepreneurs to build an Internet fortune, the 67-year-old made millions of dollars through the antivirus software that now carries his name.
McAfee's behavior has been increasingly erratic in recent years but there is no international arrest warrant for him. Police in Belize say he is not a prime suspect.
Government spokesman Francisco Cuevas said the entrepreneur would be expelled to Belize and he expected the process to be completed by early Thursday morning.
Fernando Lucero, spokesman for Guatemala's immigration department, saidimmediate deportation had been ruled out. McAfee's lawyer Telesforo Guerra was seeking an injunction to have him released and the American said on his blog www.whoismcafee.com that he would not now be returned to the Belize border until a higher judge reviewed the case.
McAfee was taken to a residence belonging to the immigration department guarded by a small group of police.
He had been seeking political asylum in Guatemala, which has been embroiled in a long-running territorial dispute with Belize. .
Residents and neighbors on the Caribbean island of Ambergris Caye, where McAfee has lived in Belize for about four years, say he is eccentric, impulsive, volatile and at times unstable, citing his love of guns and young women.
McAfee has said he believes authorities in Belize will kill him if he turns himself in for questioning. Belize's prime minister has denied this and called him paranoid and "bonkers."
"It's a wild, wild country," McAfee told in an interview in his hotel room just hours before his detention.
"Everyone sees one part of Belize," he said. "They think it's a wonderful, peaceful, lovely place, blue waters, so McAfee has got to be crazy. Maybe I am crazy. If I were, I wouldn't know."
In Belize, he was often seen with armed bodyguards dressed in camouflage, pistols tucked into his belt. McAfee's slain neighbor had complained about the loud barking of dogs that guarded his exclusive beachside compound.
His run-in with authorities in Belize is a world away from a successful life in the United States, where the former Lockheed systems consultant started McAfee Associates in the late 1980s. McAfee has no relationship now with the company, which was sold to Intel Corp.
There was already a case against McAfee in Belize for possession of illegal firearms, and police had previously raided his property on suspicion he was running a lab to make illegal synthetic narcotics.
He says he has not taken drugs since 1983.
"(Before then) I took drugs constantly, 24 hours of the day, I took them for years and years. I was the worst drug abuser on the planet," McAfee said. "Then I finally went to Alcoholics Anonymous, and that was the end of it."
But he has no regrets about the path his life has taken, or the loss of the lion's share of his fortune over the years and says he is happier now that he cares less for material things.
"My life has not declined," he said. "My life has been on the increase ever since I decided that stuff - houses, money - doesn't mean much. I had more money than I could spend in million lifetimes. Why would I care?"
McAfee says he has been persecuted by Belize's ruling party because he wouldn't pay out some $2 million to it.
"The misunderstanding of the severity of their request for money was my big mistake," McAfee said. "Had I known that, I would maybe have said $2 million is way too much. Let's negotiate something, just don't rape me for the next seven months. Writing a check would have been a lot easier."
The party has denied soliciting money from him.
McAfee has been living in the tiny Central American nation for about four years, and wants to return to live there eventually. But he says he is being framed, and denies any involvement in his neighbor's killing.
"We had one disagreement about a dog. I had disagreements with all my neighbors about my dogs. I had a disagreement with myself about my dogs. They were noisy," he said.
"Why would I leave behind the body and all the evidence?" he asked. "I'm not stupid."