Pierre Je Bron Moore will serve 28 to 34.67 years in prison, as part of the plea deal.
Maleah Williams was shot in the head outside her godparents' apartment on Christmas Day in 2015. She was taken to UNC Children's Hospital but later died from her injuries.
"I was sick to my stomach," Laurunda Craig, a close family friend, told ABC11 at the time. "It's painful and it's hurtful and it's sad that she had to lose her life to an act of violence over somebody else's problems. And it's just very hard to deal with for me. And I know it's hard for her parents as well."
Ramone Jamarr Alston was found guilty of first-degree murder in the case last year.
Charges were dropped against another man who was originally charged in the shooting.
Tylena Williams, the girl's mother, told ABC11 what happened in the moments before her child was hit.
She said under the watch of several adults, about 10 children were running around, playing with their new Christmas toys. Williams said she was holding Maleah when she saw a car drive through the parking lot, then back up a hill before stopping near a set of dumpsters. She said a man inside the car started spraying bullets into the yard down below.
"And he just started shooting and I started running," Williams said. "I felt my body being so warm and my baby was just bleeding so much and gasping for air and I kept telling her I love her -- please don't leave me."