On Thursday, the Maryland Court of Special Appeals ruled that Adnan Syed, whose case was chronicled in the hit true crime podcast “Serial,” should be granted a new trial on all charges.

Eighteen years ago, in 2000, Syed was found guilty on charges that he kidnapped and murdered his former girlfriend, Hae Min Lee. A jury sentenced Syed to life in prison, plus 30 years. He has spent nearly two decades in prison since.

The announcement of the retrial was celebrated by Syed’s supporters. But what happens next largely depends on whether the state decides to appeal the court’s ruling. It has 30 days to make a decision.

Here’s what we know about the call for a retrial — and what’s next.

What led the court to call for retrying the case?

This latest decision is part of a yearslong appeals process that has revolved around the same claim: that Syed’s lawyer failed him in not calling on a key alibi witness at his trial two decades ago. That witness was a classmate of Syed’s named Asia McClain, who said she saw Syed at a public library at the time of the murder. It feels a little bit like vindication but I am also afraid to use that word because he’s not home yet because the state does have the right to file another appeal. – Rabia Chaudry, Syed family friend

In 2014, the Serial podcast cast a national spotlight on McClain’s overlooked alibi testimony. The podcast, from the creators of NPR’s “This American Life,” became the most downloaded of all time, according to NPR. It also won a Peabody Award, the “Pulitzer Prize” of radio and other digital media.

Syed’s lawyers appealed his conviction in 2016 based on what they called ineffective counsel. He was granted a retrial in 2016 by Judge Martin P. Welch of the Baltimore City Circuit Court.

The state appealed that ruling to the Court of Special Appeals. On Thursday the appeals court affirmed that lower court’s ruling that vacated (threw out) his murder and kidnapping conviction and also ruled that Syed should get a retrial.

Why did the court order a retrial?

In a 138-page ruling, Maryland Court of Special Appeals said Syed received ineffective legal counsel at his trial because his original lawyer Maria Cristina Gutierrez — who died in 2004 — did not call a key witness: McClain. The three judge panel found that the alibi testimony was so significant that it might have changed the jury’s verdict by raising a “reasonable doubt in the mind of at least one juror” about Syed’s involvement in the murder.

It was Syed’s family friend, a law student named Rabia Chaudry, who had independently reached out to McClain. Chaudry, now a lawyer, has since championed Syed’s innocence; she was featured heavily in the first season of the “Serial” podcast that catapulted the case into the national spotlight. She also co-wrote a book about the case.

Upon word of the ruling, Chaudry tweeted “WE WON WE WON WE WON WE WON!!!!!!!!!

#FreeAdnan.” Shortly after the ruling came down, Chaudry told the PBS NewsHour that “I was shaking for a good hour … [I feel] like we have been holding our breath for 19 years.” she said.

“It feels a little bit like vindication but I am also afraid to use that word because he’s not home yet because the state does have the right to file another appeal,” Chaudry said.

How unusual is this?

For a court to overturn a conviction, particularly on the basis that the defendant’s counsel was ineffective, is rare, said Erica Zunkel, a criminal defense expert and law professor at the University of Chicago Law School. “It does not require much to be considered effective. There has been cases where an attorney has been sleeping, drunk or in bad health during a trial and the high courts have found that this did not result in a bad outcome,” Zunkel said.

How is the state responding?

The State’s Attorney’s Office in Baltimore City could not be immediately reached for comment.

Maryland Attorney General Brian Frosh’s office, which represents the state in the case, said that it is “currently reviewing today’s decision to determine next steps,” including whether to appeal, according to the Baltimore Sun. It would have 30 days to do so.

“We hope that they don’t do that. We hope that they will come to the conclusion that this has gone on for long enough,” said Syed’s current attorney, Justin Brown during a news conference Thursday.

What happens next?

There are a few possibilities.

The state could appeal directly to the Maryland Court of Special Appeals, but it could also appeal to Maryland’s supreme court, said Colin Miller, an associate professor at the University of South Carolina who has followed Syed’s case closely. If the seven-judge panel refuses to hear the case, the retrial and vacated convictions would stand.

Zunkel thinks that this is the most likely option.

“They have taken it this far. They seem to be of the view that Adnan is guilty and believe that he received a fair trial,” she said.

If the state decides not to appeal, and the retrial proceeds, Miller said the state would have to build a new case, taking the transcripts from more than a decade ago to see what they could pull from the witnesses now.

“Their case is old at this point,” Zunkel added.

The most likely scenario, Miller said,is that prosecutors will offer Syed a plea deal. Both sides, he explains, have reasons to take a deal.

Miller said the prosecution does not want to “take this case to trial and reformulate their defense and get all the media attention.” On the other side, Syed has been in prison for years and does not want to put “the rest of his life at risk.”

For her part, Chaudry is optimistic. “I really do think by the end of this year we will have some final resolution on Adnan coming home.”