A Memphis store clerk was sentenced Thursday to 22 years in prison for fatally shooting a 17-year-old who had shoplifted a beer, the authorities said.

The clerk, Anwar Ghazali, 30, was convicted of second-degree murder in August after a four-day trial.

Prosecutors said the teenager, Dorian Harris, grabbed the beer from a cooler around 10 p.m. on March 29, 2018, and left the store, the Top Stop Shop, without paying. Mr. Ghazali then pulled a 40-caliber handgun from under the store counter and chased after Dorian, firing several rounds before returning to the store, prosecutors said.

Mr. Ghazali did not call the police, prosecutors said. A bullet hit the femoral artery in the back of Dorian’s left thigh and he bled to death. His body was found nearby two days later.

Lori Fowler, one of the prosecutors in the case, previously said that Mr. Ghazali “took it upon himself to be the judge and jury and the executioner over a $2 beer.”