NEW PORT RICHEY — A man who admitted to shooting his daughter's live-in boyfriend in 2013 will not be prosecuted after a judge granted him immunity Friday under Florida's "stand your ground" law.

Jeffrey Davis had been in custody for 870 days, since the July 31, 2013, incident in which he shot Michael Davis (no relation) from inside his own bedroom at his New Port Richey home. Michael Davis survived after being in a coma for three weeks. Jeffrey Davis was charged with attempted second-degree murder.

On Friday, Jeffrey Davis was slated to walk free after Circuit Judge Pat Siracusa decided the shooting was justified under the controversial law.

"Based on the testimony I'm hearing today, where Jeffrey Davis literally retreated to a bedroom in his house …" Siracusa said. "I can't say that Jeffrey Davis didn't have a right to use force on that day."

Both Davises were in the courtroom when the judge issued his ruling. Jeffrey, now 47, sat in an orange jumpsuit at the defendant's table. Michael, 29, stood in the back of the courtroom in a T-shirt, jeans and work boots. He had just testified and walked out of the courtroom as soon as he heard Siracusa's decision. Jeffrey Davis shook his attorney's hand.

Jeffrey was toiling around his house and awoke Michael around 10:30 a.m. on the day of the incident. Michael testified the first thing he said to Jeffrey upon waking up was, "What the hell are you doing?"

The two began to argue and Jeffrey ended up in his bedroom, behind a closed door. That's when their stories begin to differ.

Defense attorney Keith Hammond argued Michael tried to beat down the door, and was ultimately successful in forcing it open. The door suffered damage in the top and bottom corners on the side opposite the hinges.

But when crime scene investigators examined the door lock and the door frame, neither showed signs the door had been forced open. Hammond suggested the door may have flexed so far during the beating it just popped open. Once Michael was in the room, Jeffrey fired the lone shot, Hammond said.

On the witness stand, Michael testified he didn't beat on the door at all, and said he didn't know how the door sustained the damage. He said he was in and out of his bedroom and the bathroom and heard Jeffrey yell, "Don't try to come into my room or I'm going to shoot you." Then, Michael said, Jeffrey opened the door and shot him while Michael stood in the hallway.

Hammond also questioned Michael Davis on his previous run-ins with the law. Both Davises had previously called deputies on each other. And Michael admitted to having smashed someone's truck windows with a baseball bat 10 years ago. Jeffrey had tried to convince deputies to remove Michael from his house, but they told him he'd have to have him evicted.

"I submit he took matters in his own hands," said Assistant State Attorney Jonathan Maguire. "At no point does a heated argument rise to the level of shooting someone and claiming self-defense."

Ultimately Siracusa found Hammond's framing of the circumstances more compelling.

"From testimony, we know that Michael Davis has an anger-management issue," Hammond told Siracusa. "He retreats. You can't retreat any further than into your bedroom."