Adnan Syed, the convicted killer whose story became famous in the podcast “Serial,” is getting a new trial — 18 years after he was sentenced to life behind bars for murdering his ex-girlfriend Hae Min Lee.

The Maryland Court of Special Appeals on Thursday upheld a Baltimore judge’s 2016 ruling that vacated Syed’s 2000 conviction and granted him a new trial on the grounds that his original defense attorney did a shoddy job representing him.

His current lawyer had argued that his trial attorney, the late Cristina Gutierrez, failed to pursue a classmate’s claims that she saw Syed at the Woodlawn Public Library at 2:15 p.m. on Jan. 13, 1999 — right when investigators say Lee was being strangled to death.

“I haven’t seen a single case in which an attorney failed to contact an alibi witness in which deficiency was not found,” his attorney C. Justin Brown told the Maryland Court of Special Appeals last year.

“This is an alibi witness who is providing their phone number and their willingness to testify, and the reason, the reason that this is so important is that there is no more powerful defense than an alibi.”

His case received renewed attention after “Serial” became a sensation in 2014.