Charges were dropped against a Birmingham man accused of killing a 4-year-old girl after a judge ruled he fired in self-defense at the car the child was inside.

Darrell Montez Hutton, 34, was charged with murder and first-degree assault for a July 2017 shooting that left 4-year-old Taleayah Stafford dead, and 68-year-old Shirley Jackson Hollonquest wounded.

Hutton on Monday faced a Stand Your Ground hearing, where his attorney asked that Hutton's charges be dropped.

Jefferson County Circuit Judge Virginia Vinson issued an order Tuesday morning dismissing the charges. She wrote in her order, "Without question the defendant found himself in a position where he was in imminent fear of his life and was justified... to defend himself."

In 2006, Alabama adopted Stand Your Ground provisions to its self-defense law, eliminating the duty to retreat from situations as long as the person defending themselves is not doing something unlawful.

Legislators also added a provision that says a person who is justified using force, including deadly physical force, "is immune from criminal prosecution and civil action for the use of such force, unless the force was determined to be unlawful."

After a defendant is indicted, they may request a Stand Your Ground hearing where the defense team can present evidence and ask the judge to dismiss the charges based on the provision.

The shooting happened about 3:30 p.m. on July 9, 2017 in the city's Kingston community.

Authorities said Anthony Fowler and Taleayah's father were on the scene, while the little girl was inside their car. Police said Fowler exited the vehicle and pulled a gun, when gunfire erupted between him and Hutton. The little girl was struck in the head by a bullet fragment, and died three days later at Children's of Alabama.

Hollonquest was hit in the neck by a stray bullet. She died of an unrelated cause on Jan. 3, 2018, court records state.

Hutton testified during the hearing yesterday. He said on the day of the shooting, he was a passenger in someone's car. The car was parked, court records state, and he had the window down. Hutton said Fowler walked up to the car and put a gun to Hutton's head, pulling the trigger several times. But, the gun didn't go off.

Hutton said he pushed open the door and knocked Fowler over, and pulled his own 9 mm gun, court records state. Fowler ran away and kept trying to shoot, but his gun misfired. Hutton admitted to firing at Fowler, saying he was afraid for his life and was defending himself.

"Certainly it's unfortunate that there's a deceased child. Clearly no one intended that to happen," Hutton's attorney Scott Boudreaux said. "It was clear he had the absolute right to defend himself."

Fowler also testified and said, according to court records, he has pleaded guilty to attempting to assault Hutton but did not intend to kill him. Fowler said he was with Taleayah and her father that day, and they were headed to the grocery store. He said he and the child's father decided to stop and buy marijuana, while Taleayah was in the backseat.

Fowler said they parked next to the store and he walked to a apartment next door to buy the marijuana. According to court records, Fowler said he spotted Hutton in a car and walked over to shoot him. Fowler said he pulled the trigger several times but his gun didn't fire, and he ran.

He yelled at Taleayah's father to start the car, but the car didn't crank. Fowler said he saw Hutton shooting at him, but believed more than one person was firing. Eventually, the car started and Fowler and Taleayah's father fled.

The two didn't realize Taleayah was hurt until they pulled away, Fowler said.

Birmingham police Det. Jeffery Miller also testified and said evidence technicians recovered 19 shell casings from a .40 caliber gun near the area where Fowler was parked. Near the apartment complex where Fowler tried to shoot Hutton, Miller said there were four shell casings from a 9 mm.

Taleayah died from a bullet fragment from a .40 caliber gun.

Vinson wrote in her order, "From the evidence presented the Defendant had a 9 mm. Fowler attempted to intimate that Hutton had gotten another gun, however, the timing involved and the further testimony of Fowler 'perceiving' there was someone else shooting, and the additional .40 shell casings do not support his theory."

Deputy District Attorney Mike Philpott prosecuted the case.