McAfee, 67, 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.
Government spokesman Francisco Cuevas said McAfee would be expelled to Belize and he expected the process to be completed by early Thursday morning. McAfee's lawyer Telesforo Guerra said he would seek an injunction to have him released.
There is no international arrest warrant for McAfee. Police in Belize say he is not a prime suspect.
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.
One of Silicon Valley's first entrepreneurs to build an Internet fortune, McAfee made millions of dollars through the Internet antivirus that now carries his name. His behavior has been increasingly erratic in recent years.
Residents and neighbours 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 sa id he believes authorities in Belize will kill him if he turns himself in for questioning. Belize's prime minister has denied this a nd called him paranoid and "bonkers."
"It ' s a wild, wild country," McAfee told Reuters in an interview in his hotel room just hours before his detention.
"Everyone sees one part of Belize ," he said. " T hey think it's a wonderful, peaceful, lovely place, blue waters, so McAfee has got to be crazy. Ma ybe I am crazy. If I were, I wouldn't k now."
In Belize, he was often seen with armed bodyguards dressed in camouflage, pistols tucked into his belt. McAfee's slain neighbour 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.
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 th at he ca res less for ma terial th ings.
" 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 t o 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 n egotiate something, just don't r ape me for the next sev en mon ths. 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."