OCEAN COUNTY – It was a crime that shocked the Jersey Shore. A Pemberton man accused of killing a man in a brutal stabbing attack, was sentenced to 30 years in state prison.

The Ocean County Prosecutor’s Office confirmed 27-year-old Alan McGinnis of Pemberton was sentenced Friday for murder in the first degree.

McGinnis confessed to the murder of 20-year-old Cody MacPherson in December of 2018. McGinnis stabbed MacPherson in the neck and chest on September 24, 2017. He admitted to placing MacPherson’s body into the trunk of a vehicle and then dumping the body in a wooded area in Jackson.

According to prosecutor Bradley Billhimer, MacPherson’s remains were found during a controlled burn by a District Warden with the Jersey Forest Fire Service on March 19, 2018.

McGinnis will be required to serve the full sentence of 30 years.

The motive appeared to have been over an ex girlfriend who the victim was now involved with.

MacPherson’s body had been found on March 19 by a fire warden preparing the land for a controlled burn, police said. District Warden Richard Byrne spotted human remains under logs in the area between 433 and 483 on South Stump Tavern Road in the Colliers Mills Wildlife Management Area. When he approached the remains, he saw what appeared to be a skull and called police. He then called his supervisor to make sure that the controlled burn would stop to preserve any evidence.

Detective Shaun Clark, the State Police Homicide Unit, and the Major Crime Homicide Unit of the Ocean County Prosecutor’s Office responded. An initial investigation showed that the remains were most likely MacPherson, who had been reported missing out of Burlington County months earlier.

The next day, a forensic pathologist at Community Medical Center in Toms River ruled the cause of death to be a stab wound to the left abdomen. X-rays of the teeth were consistent with those of MacPherson.

Dr. Dante Ragasa was assisted by forensic anthropologist Anna Delaney, and forensic odonatologist Dr. Stewart Alexander.

Search warrants were served at 6 a.m. on April 21 in a location in Pemberton and Jackson.

According to a press release from the Prosecutor’s Office, a comprehensive multiagency investigation conducted by numerous law enforcement officers led to his apprehension. They included Pemberton Police, the Ocean County Prosecutor’s Office, Burlington County Prosecutor’s Office, the NJ State Police Major Crimes Unit and Jackson Police.

Kimberly Bosco contributed to this report.