A convicted murderer who served time behind bars for a teenage friend’s 1993 shotgun slaying in a Hicksville park will be heading back to prison soon after his plea Wednesday in a separate gun and drug case.

Robert D’Andrea III, 38, of Huntington Station, pleaded guilty in Nassau County Court to having a loaded gun and heroin after his arrest in May in Island Park.

Back in 2000, D’Andrea admitted to the 1993 murder of Bryan Levine, who was 16 when D’Andrea shot him as he slept on bleachers in Libby Park in Hicksville.

D’Andrea, who was 15 at the time of that crime, wasn’t arrested until 1999 after his former girlfriend decided to cooperate with police.

In 2000, a judge sentenced D’Andrea, then 22, to 7 years to life in prison for second-degree murder after his prosecution as a juvenile.

“I wanted to kill him,” D’Andrea said at the sentencing, as the victim’s family wept. Police had said D’Andrea told friends that Levine had stolen CDs and video games from him.

advertisement | advertise on newsday

State corrections records show D’Andrea got out on parole in 2010.

On Wednesday, acting State Supreme Court Justice Patricia Harrington told D’Andrea that she would sentence him to 5 years in prison and 5 years of post-release supervision after his plea in the new case.

“I believe it is in the interest of justice to accept this plea from you,” she said.

On May 18, Nassau police arrested D’Andrea after he ran a stop sign and they found him with heroin, cocaine and a loaded .45-caliber semi-automatic pistol during a traffic stop, according to authorities.

“This defendant had a loaded, unregistered weapon that endangered everyone around him,” Nassau District Attorney Madeline Singas said in a prepared statement Wednesday. “Our community is safer with this dangerous man and this illegal gun off the street.”

D’Andrea’s Legal Aid attorney, Tatiana Miranda, declined to comment on his case Wednesday.

D’Andrea refused to answer questions as court officials led him away in handcuffs after his guilty plea.

The judge set the sentencing for Sept. 7.