COLUMBUS, Ga. (AP) — A Georgia judge has dismissed a murder charge against a teen after concluding that he was legally justified in shooting a man seven times in 2021 because the man was trying to kidnap him.

The Ledger-Enquirer of Columbus reports that Muscogee County Superior Court Judge John Martin dismissed charges Wednesday against the unnamed teen at the behest of prosecutors who concluded from witnesses and video footage that the boy had a right to defend himself to stop a forcible felony under Georgia’s “stand your ground” law.

The boy, then 16, shot and killed Iverson Gilyard in August 2021 at a Columbus park. The newspaper withheld the boy’s name because he was a juvenile and has now been cleared of charges.

The boy was indicted as an adult in February for murder, aggravated assault, and possessing a gun while committing a felony. But prosecutors later concluded that Gilyard was the primary aggressor, entering the park and hitting the boy over the head with a handgun three times as the boy tried to get away.

Assistant District Attorney Robin Anthony said Gilyard, 22, also threatened to shoot the teen, saying “I’m going to bust you in the kidney.” When parents at the park complained, Anthony said Gilyard told the teen to follow him, stuck the gun in his waistband, and said, “You’d better not run, either.” Anthony said when Gilyard turned to walk away, the teen took a gun from his backpack and shot Gilyard. The 22-year-old was shot seven times, four times in the back, his family has said.

Martin agreed to drop the charges Wednesday, saying the boy believed he was being kidnapped, and that “the use of deadly force was necessary to prevent death or serious bodily injury to himself.”

Stand-your-ground laws remove a person’s duty to retreat from illegal attacks before using deadly force in self-defense. Opponents say they promote violence. But even before Georgia’s law passed in 2006, the teen could have been justified in using deadly force as the victim of a crime.

Gilyard’s mother, Tiesha Gilyard, had said in interviews that she did not think the shooting of her son was justified, saying he had put his gun away and that the teen shot Gilyard in the back first before coming and shooting him in the chest once Gilyard was down.

“Once he was down, he came up to him as if that was not enough, point blank range, and shot him three times in the chest,” Tiesha Gilyard told WRBL-TV in July. “If you shoot someone one time, they’re down. You got a park full of people. They’re down. This was malicious.”

“Any person has the right to use self-defense, even deadly force, to prevent a serious violent felony happening to themselves,” District Attorney Stacey Jackson told WRBL-TV in July.

The teen’s defense attorney, Jennifer Curry, was not immediately available for comment. Curry earlier told the Ledger-Enquirer that her client and his family were threatened after Gilyard’s death, with someone shooting into the mother’s home before the boy was released from juvenile detention.