MACON, Ga. — On Friday, a Peach County jury acquitted Lonnie Shaw on all charges.

He was charged with aggravated assault and possession of a firearm during the commission of a felony, after he allegedly pointed a gun at a Peach County deputy when he knocked on Shaw's door around 3 a.m. one morning.

The deputy shot Shaw, but Shaw was ultimately charged, even though he claimed he never pointed the gun at the deputy.

RELATED: Lonnie Shaw acquitted after being shot by Peach County deputy

The jury didn't buy the prosecution's case.

After the not guilty verdict came down, Macon Judicial Circuit District Attorney David Cooke released a statement that seemed to suggest Shaw shouldn't have had the gun with him when he answered the door.

That statement read, in part, "Mr. Shaw is fortunate to have his freedom, and that his injuries weren't more severe after he chose to answer the door holding a gun knowing police officers were on the other side."

The suggestion is clear, but what does the law have to say about it? Is it legal to bring a gun to the door of your home when someone knocks?

According to Mercer Law school professor David Oedel, as long as you're not threatening someone with it the answer is clear. "Yes. In short, you can answer your door with a firearm in hand, although you cannot point it at somebody unless you have a reasonable threat being posed by the person at the door," said Oedel.

According to the legal scholar, the Second Amendment and Georgia's so-called "Castle Doctrine law" give homeowners legal rights to carry a weapon at home, even when answering the door for law enforcement.

When we asked him about this, Cooke didn't deny that's legal -- as long as you're not pointing the gun.

"Legally, you can have a weapon in your hand when you encounter the police," said Cooke. "I don't recommend it for the safety of yourself, for the safety of the police, or anyone in gunshot range of you."

But Cooke said regardless of its legality, he thought it was a poor choice. "There are many things that are legal that are nonetheless foolish and can lead to someone else dying," said Cooke.

Cooke stressed he believes Shaw knew police were at the door when he answered them and his office argued that at trial. The prosecutor in the case argued Lonnie Shaw knew the police were at the door because his wife could see them in the home's surveillance system.

However, Shaw testified that he didn't hear her tell him who was out there. All he knew was someone was at his door around 3:00 in the morning.

RELATED: He was shot by a Peach deputy, but he could go to prison

Deputies also testified they did not verbally identify themselves as law enforcement officers or have their police lights or siren on.