A judge in Guatemala has granted a stay of the deportation of John McAfee to Belize, where authorities want to question him about the killing of a neighbor, an attorney for the internet software pioneer said Friday.

Under the order, McAfee will remain in Guatemala until his immigration case is heard in court, which may be more than a month, Telesforo Guerra told CNN.

McAfee remains in an immigration detention center in Guatemala City but could be released as early as next week, the lawyer said.

Authorities in Belize want to talk to him about the November 11 killing of his neighbor, American businessman Gregory Faull.

The judicial victory came a day after McAfee's bid for asylum was rejected. Also Thursday, the 67-year-old was taken to a police hospital, where he was treated for cardiovascular problems, his legal team said.

Later, attorney Guerra said McAfee had suffered a nervous breakdown and that tests had shown he did not have heart problems.

JUST WATCHED

Runaway software tycoon arrested

MUST WATCH

The events were the latest in a saga that includes poisoned dogs, a dead neighbor and international intrigue.

Guatemalan authorities took McAfee into custody Wednesday on accusations of entering the country illegally.

After weeks in hiding, the anti-virus software company founder had emerged publicly Tuesday in Guatemala's capital, hundreds of miles from the Caribbean island in Belize where the body of his neighbor was found.

McAfee had sought asylum in Guatemala, arguing that he left Belize to escape police persecution.

But Guatemalan authorities found there was no basis for his asylum request, presidential spokesman Francisco Cuevas said Thursday.

McAfee founded his computer security software company -- McAfee Associates -- in 1987, initially running it from his home in California. Seven years later, he sold his stake in the company. He moved to Belize in 2008.

On November 9, he told police someone poisoned four of his dogs. To put them out of their misery, he shot each in the head and buried them on his property, a former girlfriend said.

The dogs' barking and aggressive behavior had been a source of friction between the neighbors.

Two days after the dogs were poisoned, Faull's body was found, fatally shot in the head.

McAfee has said he had nothing to do with the death and accused Belize authorities of being out to get him for having refused months earlier to pay a bribe to a politician.

Belize police say they only want to talk with McAfee.

"He's really gone out of his way to make the country look bad," police spokesman Raphael Martinez said this week. "We just believe he should, if he's innocent as he's saying he is, he should bring in his lawyer, and let's get to the bottom of this and say what he needs to say and let's move on."