A former sailor in the US Navy stabbed a woman 119 times when she revealed she was transgender after they had sex, a court heard.

Dwanya Hickerson, 21, "lost it" after learning Dee Whigham, 25, had been born a man.

Mississippi's Jacksonville Circuit Court heard that he knifed Ms Whigham multiple times in the face and slashed her throat in a hotel room before showering and leaving her for dead.

The pair had been chatting online for two months after making contact through a dating site.

They decided to meet for the first time when Ms Whigham was visiting the city of Biloxi, where Hickerson lived, on July 23 last year.

The hospital nurse picked him up at the gates of Keesler Air Force Base, where he was training to be a weather forecaster, and drove them to her hotel, the court heard.

CCTV footage showed them walking into her room together at Best Western at about 8.30pm. Hickerson was seen leaving 23 minutes later with his shirt around his neck.

Dwanya Hickerson, 21, was jailed for 40 years for murder (Jackson County Sheriff Department)

Ms Whigham's body was found at about 9.45pm by her friends.

An Air Force instructor later recognised Hickerson in a police appeal over the killing and reported him to detectives, according to the WLOX news channel.

Hickerson later told police he and Ms Whigham had sex at the hotel before she told him she was transgender.

"I lost it, I lost it," he said, adding he did not remember much afterwards.

He was jailed for 40 years without parole after pleading guilty to second-degree murder. He will also have to serve 15 years for a robbery charge after taking Whigham's purse and mobile phone.

Hickerson could have faced the death penalty if he had been convicted of capital murder.

Ms Whigham's mother, Vickie Blackney Whigham, criticised Hickerson's sentence.

"I think the plea is a slap in the face," she said. "He gets a chance to see his family and I don't have that chance with my child."

For more news videos visit Yahoo View, available on iOS and Android.