BIRMINGHAM, Ala. (AP) — An Alabama judge has dismissed a capital murder charge against a man, ruling that he acted under the state’s Stand Your Ground law, which allows people to use deadly force in self-defense.

Jefferson County Circuit Judge Alaric May issued an order Saturday tossing the charge against 23-year-old Samuel Bernard Smith of Birmingham.

Police said 32-year-old Kirby Kermit Davis was shot to death Dec. 20, 2018, at an apartment complex where Smith was living. Smith was arrested in early 2019 and has been out of jail since last year.

May ruled because Smith was robbed and kidnapped by four men, he had the right to defend himself.