A 20-year-old Cobb County man told a jury it was illegal drugs — not him — to blame for a robbery, assault and home burglary.

But the jury convicted Johnny F. Pineda of Smyrna in the November 2012 home invasion, Cobb District Attorney Vic Reynolds said Thursday. Pineda was sentenced to 30 years, with 18 years to serve in custody and the rest on probation.

“The jury convicted the defendant, Mr. Pineda, despite his excuse that he was not culpable due to his excessive use of illegal drugs,” Assistant District Attorney Marty First said in an emailed statement. “He’s been in trouble since the age of 12, and has continued causing trouble even in jail. He lied on the stand during the trial. The danger he imposed on these victims and on society at large demand stiff consequences.”

A jury found Pineda guilty of two counts of armed robbery, aggravated assault and burglary, Reynolds said. Evidence showed Pineda and Zyheed T. Roberts were armed when they entered a home in the 600 block of Windcliff Drive on Nov. 25, 2012, and robbed several juveniles of laptops, jewelry and other items.

Roberts previously pleaded guilty in the case, Reynolds said. On Sept. 9, 2013, Roberts pleaded guilty to robbery, aggravated assault and burglary charges, and was sentenced to 20 years, including eight to serve in prison, the DA’s office said. Roberts was not armed during the home invasion.

During the sentencing hearing Wednesday afternoon, 17 Cobb deputies testified about criminal acts and rule infractions Pineda has committed while he’s been in jail awaiting trial, Reynolds said. Pineda has been in jail since the night of the home invasion, booking records showed.