A former New Mexico high school chemistry teacher was sentenced to prison after being convicted of creating methamphetamine -- a crime that drew similarities to the plot of the television series "Breaking Bad" and its main character, Walter White.

Ex-chemistry teacher gets four years for cooking meth. Sound familiar? https://t.co/qLbYTIXigL pic.twitter.com/AXK7iFSTjT — NBC News (@NBCNews) July 20, 2017

John W. Gose, 53, was sentenced to nine years in prison, but a judge “suspended all but four years” after Gose pleaded guilty in May to “trafficking by manufacturing a controlled substance among four methamphetamines-related counts,” according to the Santa Fe New Mexican.

10-YEAR-OLD TRIPS INTO MILLION-YEAR-OLD DINOSAUR FOSSIL DISCOVERY IN NEW MEXICO

Gose also will have to fulfill five years of probation after his release.

New Mexico police arrested Gose in October after chemicals, glassware and rubber tubing were discovered at the time of a traffic stop.

Police also discovered chemicals and supplies at Gose’s home. Gose had enough methamphetamine ingredients to create a pound or more of the drug, which had a street value of $44,800.

NEW MEXICO PROFESSOR SEEKS TO SAVE MOON-LANDING SITES

Gose's crimes mirrored the Emmy Award-winning AMC drama “Breaking Bad,” which follows Walter White, a chemistry teacher in New Mexico, who begins to cook methamphetamine after being diagnosed with lung cancer.

Gose was initially facing 20½ years in prison for the charges.

Gose used to teach science to high schoolers in El Paso and middle schoolers in Las Cruces, authorities said. Gose reportedly told a roommate that he had taught chemistry.