Amber Guyger, the former Dallas police officer convicted of murder for fatally shooting her unarmed neighbor in his apartment, was sentenced Wednesday to 10 years in prison.

Guyger, 31, learned her fate after a sentencing hearing that included emotional testimony from the family of the victim, Botham Jean, and revelations that she shared racist and offensive texts and social media posts.

Prosecutors had asked jurors to sentence Guyger to at least 28 years — symbolic because Jean would have turned 28 last Sunday.

In a dramatic victim's impact statement, Jean's brother, Brandt Jean, forgave Guyger and embraced her in court.

Addressing Guyger directly, he said, "If you truly are sorry — I know I can speak for myself — I forgive you, and I know if you go to God and ask him, he will forgive you."

Botham Jean in an undated photograph. Harding University

Brandt Jean, who acknowledged that he was not speaking for his family, added: "I personally want the best for you. I wasn't even going to say this before my family, but I don't even want you to go to jail. I want the best for you, because I know that's exactly what Botham would want you to do — to give your life to Christ."

Brandt Jean then asked permission to hug Guyger, which was granted. He walked over to Guyger and embraced her for almost a full minute as loud sobs rang through the courtroom.

The Jeans' mother, Allison Jean, had testified Tuesday that she still struggles with the trauma of her son's death, saying: "I cannot sleep. I cannot eat. It's just been the most terrible time for me."

Guyger did not testify during her sentencing, but she has the opportunity to appeal the conviction in the unique case, which has gripped the city of Dallas and shattered the idea that law-abiding residents can be safe in their own homes.

Protesters blocked traffic in the area near the courthouse for about three hours Wednesday night, police said. One person who failed to clear the roadway was arrested.

The jury was allowed to consider whether Jean's death was the result of "sudden passion," which meant Guyger acted in the heat of the moment. It carried a lesser sentence of two to 20 years behind bars.

Guyger, a five-year police veteran, lived one floor below Jean, 26, an accountant, in their apartment complex. She testified that she was off-duty but in uniform when she mistakenly entered his unit on Sept. 6, 2018, after a long shift at work, believed Jean was a burglar and shot him in the chest, saying she feared for her safety.

Download the NBC News app for breaking news and politics

Guyger is white, and Jean, a native of the island nation of St. Lucia who moved to Dallas for a job with PricewaterhouseCoopers, was black. His death stoked protests, led to Guyger's firing and renewed conversations about police use of force and racial bias.

During the sentencing hearing Wednesday, Guyger's mother, Karen Guyger, 66, testified that her then-boyfriend had molested Guyger when she was 6.

She said she reported the assault to police and that the man was arrested. NBC News was unable to immediately learn the outcome of the case.

Karen Guyger added that her daughter was distraught after killing Jean.

"She feels very bad about it," Karen Guyger said through tears.

Dallas County prosecutors built a case through Guyger's police disciplinary records, texts and social media posts to speak to her character and argue that she was undeserving of a lenient sentence.

Jurors were shown three Pinterest posts that Guyger had saved to her account and commented on. They included the picture of a military sniper with text that read: "Stay low, go fast; kill first, die last; one shot, one kill; no luck, all skill."

In another Pinterest post, Guyger commented under a picture of a Minion from the movie "Despicable Me": "People are so ungrateful. No one ever thanks me for having the patience not to kill them," the comment read.

New texts were also shown to jurors between Guyger and her married work partner, Officer Martin Rivera, with whom she had been having an affair. Prosecutors had revealed their sexually explicit texts during the trial, although the defense downplayed them, saying the two were already "ramping down" their relationship by the time the shooting occurred.

Rivera texted to Guyger in March 2018: "Damn I was at this area with 5 different black officers !!! Not racist but damn."

She responded: "Not racist but just have a different way of working and it shows."

Guyger texted with another officer last year about the Martin Luther King Jr. parade in Dallas.

"When does this end lol," the officer wrote to Guyger.

"When MLK is dead … oh wait …," she joked.

Two days before Guyger fatally shot Jean, she texted with someone who had adopted a German Shepherd.

The dog's owner wrote of the animal: "Although she may be racist."

Guyger responded, "It's okay ... I'm the same," and later added: "I hate everything and everyone but y'all."

During the sentencing phase, defense attorney Toby Shook asked the jury to think about how Guyger helped others as an officer and largely glossed over the derogatory texts.

"Through these horrible series of events, she went into his apartment by mistake," Shook said. "She pulled that trigger in an instant — an instant she will regret for the rest of her life. ... She didn't go there seeking to kill him."

Allison Jean cries while speaking about her son Botham Jean during the sentencing testimony for former Dallas police officer Amber Guyger on Monday. Tom Fox / The Dallas Morning News via AP

Jean was watching television and eating a bowl of vanilla ice cream in his living room just before 10 p.m. when Guyger burst inside, likely scaring him, prosecutors said at trial. Guyger testified that she used her electronic key fob in the lock but that the door still pushed open and that she immediately drew her service weapon once she was inside.

The trajectory of the bullet showed that Jean was either getting up from his couch or cowering when Guyger fired at him, the prosecution said.

The jury, made up of mostly women and people of color, deliberated for about five hours to convict Guyger and has been sequestered during the trial, which began Sept. 23.

Guyger was taken into custody at the end of the first day of the sentencing phase, which started after the verdict was read Tuesday. She was booked into the Dallas County Jail.