Attorney Jarrett Adams recently helped overturn an innocent man's conviction — in the same state that, years ago, had sentenced him to prison for a crime he did not commit.

The case was Adams' first professional win. But it was also deeply personal for the 36-year-old, who spent nearly 10 years behind bars after being wrongfully convicted of sexual assault in a case that Adams, who is black, believes was tainted by racism.

"This is a storybook," Adams told NBC News' Lester Holt. "It's a storybook tale that you wouldn't believe until you saw it ... to have a conviction overturned and in a court, in a state, that I was wrongfully convicted."

Adams was only 17 when an encounter at a party, an accusation, and a court-appointed attorney put his life on hold.

He had just finished high school on Chicago's South Side and decided to go to the University of Wisconsin for a party, where he and his friends met a young woman and had what he describes as a "completely consensual encounter from beginning to end."

Three weeks later, as Adams was getting ready to start junior college in the fall of 1998, he was arrested. An officer informed him that the woman said she was raped, and that he was being charged with a group sexual assault along with two other teenagers.

Adams had never been arrested before. He denied the crime from the start, and thought the misunderstanding would get resolved quickly.

Instead, he was extradited to Wisconsin, where he couldn't afford legal assistance. A court-appointed attorney chose not to put on a defense, even though there was a witness who could have helped clear Adams: a student living in the dorm who could corroborate Adams' timeline of events.

Jarrett Adams Courtesy of Jarrett Adams

"This guy is telling us, 'We know you didn't do it. They haven't proven their case. The best defense is a no-defense strategy,'" Adams said. "We're like, 'Yeah, sounds good,' because we didn't know any better, right? But in reality, it was a horrible idea to not call any witnesses, not to investigate, and to put this in front of an all-white, racially charged jury. We didn't stand a chance."

The result was a conviction with a stunning 28-year prison sentence for Adams; 20 years for another teen who couldn't pay for representation; and an acquittal for the third, who had hired a private lawyer, and called the alibi witness.

"My only encounter with the criminal court system was 'Law & Order.' And at the end of those commercials, and that theme music comes on, you don't see guys who are wrongfully convicted go to prison and get sentenced to 28 years," Adams said.

Inside prison, Adams met a cellmate who worked for the prison law library and encouraged him to try to get his conviction overturned.

"My only encounter with the criminal court system was 'Law & Order.' And at the end of those commercials, and that theme music comes on, you don't see guys who are wrongfully convicted go to prison and get sentenced to 28 years."

"He said, 'Listen. I go over hundreds of inmates' cases, and all of them say the same thing: I'm innocent.' He said, 'I've never seen a case like yours before. You're in here for some racist bull crap, and you've essentially waved the white flag,'" Adams said.

The cellmate urged him not to give up: "It's only going to take a second before you have tattoos on your face and have given up and completely don't care at all. You need to go down swinging," he told Adams.

So, Adams started reading law books and found a Supreme Court case that stated that the Constitution required defendants be provided effective assistance of counsel. He got in touch with attorney Keith Findley with the Wisconsin Innocence Project, a state chapter of the nonprofit devoted to justice for wrongfully convicted people.

Findley knew the case was an uphill battle, but he took it on.

"He had done his homework. He knew the case, factually, better than anybody, and he knew the law, so that he was engaging with us, discussing legal issues, strategy," Findley said.

Adams' sentence was eventually overturned and the charges dropped, for the exact reason that he had found in the prison law library books: ineffective assistance of counsel.

A month after he was freed in 2007, Adams enrolled in community college, went on to earn his Bachelor's degree and attended law school, graduating in 2015.

Last summer, he became the first Innocence Project exonoree to be hired as an attorney by the organization.

"What I wanted more than anything was this: I wanted my mother, when she went to church and people asked about her son, for her not to duck her head in her Bible and cry. And I wanted her to be proud," he said.

Recently, Adams found himself back in a Wisconsin courtroom, this time working side-by-side with his former attorney Findley, to free another man they believed was wrongfully convicted.

Richard Beranek was convicted of rape in 1990. Although he had alibi witnesses that put him in another state at the time of the rape, the jury found the testimony of an FBI expert tying him to the scene through a microscopic hair analysis convincing enough to deliver a guilty verdict.

Adams — who served time in the same correctional facility as his client — was dedicated to freeing him, Findley said.

"I can talk to Richard about what I've seen other exonerees go through, what the experience looks like from the outside, but I couldn't do what Jarrett can do. I couldn't speak with the authenticity of knowing what it feels like, that Jarrett can speak to," Findley said.

In June, a Dane County circuit judge overturned Beranek's conviction, citing DNA evidence that proves the FBI hair analysis was wrong. Beranek is now a free man, in large part thanks to Adams' tireless work.

"Nothing pays me back more, or my family, than me walking in the same court, in the same state, where they didn't even look at me when they gave me 28 years," Adams said. "But now they have to acknowledge me as 'Attorney Adams.'"