A North Carolina man accused of shooting and killing a 5-year-old boy in an unprovoked attack has avoided the death penalty by pleading guilty and will serve the rest of his life in prison without parole.

Darius Sessoms, 25, pleaded guilty to first-degree murder on Thursday at the Wilson County Courthouse for the August 2020 shooting of 5-year-old Cannon Hinnant in a case that a judge ruled in October would be tried as a capital murder case that brought a possible death sentence, WRAL-TV reported.

Sessoms had been charged after prosecutors say he walked up to Cannon, his neighbor in Wilson, North Carolina, and shot him in the head at point-blank range as the boy rode his bike in front of his 7-year-old and 8-year-old sisters. 

Cannon’s father, who owned the house where the young boy was playing in front of, said Sessoms was friendly with the Hinnant family and had been over to the house the night before to drink a beer.

NORTH CAROLINA BOY CANNON HINNANT, 5, LAID TO REST AFTER SENSELESS MURDER: YOU 'CAN'T IMAGINE WHAT IT'S LIKE'

Cannon Hinnant and Darius Sessoms

Darius Sessoms, 25, was sentenced to life in prison without parole for the murder of 5-year-old Cannon Hinnant in North Carolina. (Hinnant Family, Wilson PD)

"There wasn't anything between me and him, any bad blood whatsoever, for him to have a reason to do this," Austin Hinnant told WRAL-TV after the murder.

"I have no idea why he did what he did," Hinnant added. "It was literally out of nowhere. He puts a gun to my son’s head and shoots him."

5 UNLIKELY US CITIES THAT STRUGGLED WITH RISING VIOLENT CRIME IN 2022

Sessoms’ parents said they believe their son was on drugs and having hallucinations at the time of the shooting.

Darius Sessoms

Darius Sessoms, 25, pleaded guilty to murdering 5-year-old Cannon Hinnant. (Wilson Police Department)

Cannon’s murder reverberated throughout North Carolina with well-wishers donating over $800,000 to a GoFundMe page for the family, who had publicly stated they were seeking the death penalty.

PARENTS 'CLEARLY' HIDING INFORMATION ABOUT MISSING 11-YEAR-OLD GIRL: POLICE

"I want the death penalty, and I’m going to seek it," Bonny Waddell, Cannon’s mother, said in 2020.

Sessoms entered an Alford plea, which allows a defendant to maintain his or her innocence but acknowledges that prosecutors have sufficient evidence to secure a conviction. 

CLICK HERE TO GET THE FOX NEWS APP

Wilson County Courthouse building in North Carolina

The Wilson County Courthouse building in North Carolina. (Google Maps)

Sessoms' girlfriend at the time of the killing, Aolani Pettit, pleaded guilty to obstruction of justice and was sentenced to a suspended four- to 14-month sentence, along with 18 months supervised probation, WRAL-TV reported. 

The Associated Press contributed to this report