U.S. Attorney General Jeff Sessions today said the justice department will work to protect the rights of transgender victims of violence.

The statement came after a Mississippi man became the first person in U.S. history sentenced to prison for violating federal hate crime laws against a transgender person -- the murder of a transgender Alabama teenager.

The case, watched nationally amid concerns transgender women are particularly vulnerable to violence, drew comment from Sessions.

"Today's sentencing reflects the importance of holding individuals accountable when they commit violent acts against transgender individuals," Sessions said in a statement. "The Justice Department will continue its efforts to vindicate the rights of those individuals who are affected by bias motivated crimes."

U.S. District Judge Louis Guirola Jr. sentenced Joshua Vallum in the 2015 killing of 17-year-old Mercedes Williamson. It was the first case prosecuted under the federal Hate Crimes Prevention Act involving a victim targeted because of gender identity.

Prosecutors said Vallum shocked 17-year-old Mercedes Williamson with a stun gun, stabbed her and beat her to death in 2015 to keep fellow Latin Kings gang members from discovering the two were having sex. Gang rules barred homosexual activity and declared it punishable by death.

Guirola could have sentenced Vallum to life in prison, but heeded a lesser sentence suggested in a plea agreement between defense attorneys and prosecutors, citing Vallum's neglected childhood and other issues. Both the judge and defense lawyers said Vallum's history of abuse as a child had to be considered.

"The taking of a human life because a person has a particular gender identity is particularly heinous and cannot be tolerated in an enlightened society," Guirola said in court in Gulfport.

Vallum pleaded guilty to the federal charges in December. He previously pleaded guilty to a state murder charge that led to a separate sentence of life without parole.

On Monday, Vallum begged forgiveness from Williamson's family and friends, though none of them were present -- only a few reporters, the judge and Vallum's father and stepmother.

"Every day, I live with the guilt and regret of my actions," Vallum said. "If I could bring back Mercedes by giving up my life, I would gladly do so."

LGBT advocates applauded federal officials' first use of the 2009 hate crimes law to prosecute an offense against a transgender person.

Demoya Gordon, attorney for the Transgender Rights Project of Lambda Legal, called the prosecution "significant" but noted it began under President Barack Obama's administration and added "the cake was already baked" on Vallum's sentencing when Donald Trump became president.

Gordon said her group remains concerned how Trump policies will affect transgender people. She cited the Trump administration's reversal of guidelines that transgender students nationwide should be able to use school bathrooms corresponding to their gender identity -- among other steps.

"These actions invite increased discrimination and continued animus against transgender people," Gordon said.

Federal prosecutor Julia Gegenheimer had said at Vallum's plea hearing in December that he began planning to kill Williamson after a friend called him in May 2015 to say he'd discovered Williamson's identity.

Vallum lured Williamson into a car in Alabama and drove her 50 miles (80 kilometers) to his family home near Lucedale, Mississippi, prosecutors said. They added he shocked her with a stun gun and stabbed her with a pocketknife. When Williamson tried to run, they said, Vallum chased her and bashed her head with a hammer.

Public defenders submitted a sealed brief Monday to Guirola outlining Vallum's troubles.

"Mr. Vallum lived through a childhood that was characterized by abandonment and neglect," said public defender Ellen Allred. "It's difficult to image how a mother could lock a two- or three-year-old child in a room for house on end while adults did drugs."

Allred said Vallum first tried to kill himself when he was 7 or 8.

"We can't go back and change Mr. Vallum's childhood, just like Mr. Vallum can't go back and undo what he did to Mercedes," Allred said.

Vallum initially told sheriff's deputies and later told The Sun Herald newspaper that he found out that Williamson had a penis on May 30, 2015 -- moments before he killed her. He said he "blacked out" and doesn't remember the crime, a variation of what's known as a "gay panic" or "trans panic" defense.

He declined to speak with The Associated Press in a March letter, citing advice from his lawyers, and didn't address the issue Monday. However, Vallum has never contested testimony and evidence that he long knew Williamson was transgender.

A witness in state court had testified previously that Vallum and Williamson had sex multiple times while the witness was a roommate with Williamson. Williamson had transitioned from male to female before dropping out of high school in Alabama, leaving her parents' home and drifting from place to place.