CHICAGO — A trial in the killing of a popular Iowa teenager whose death drew the notice of Attorney General Jeff Sessions ended on Friday with a verdict of first-degree murder.

A jury in Keokuk, Iowa, convicted Jorge Sanders-Galvez, 23, of killing Kedarie Johnson, the teenager who sometimes dressed in women’s clothing and whose mother described him as gender fluid. The trial, which stretched over two weeks, had stirred a debate over what should be deemed a hate crime.

Image Kedarie and Katrina Johnson.

Kedarie’s mother, Katrina Johnson, said she considered her son’s death a hate crime. Prosecutors laid out a case that suggested that Mr. Sanders-Galvez and a second man had pursued Kedarie, 16, one evening in 2016, believing that he was a girl, and grew enraged when, during a sex act, they discovered that he was a boy.