On the witness stand at the Leighton Criminal Court Building in Chicago on Thursday, Karl Smith made a shocking admission.

“I’m here to confess to a crime I committed that he was wrongly accused of,” Smith told the court.

“He” was not just anyone — it was Smith’s 38-year-old identical twin, according to the Chicago Tribune.

Kevin Dugar, Smith’s twin, has been in custody since 2003, the paper reported.

The men have different last names because Smith changed his last name to his mother’s maiden name, according to the Tribune.

The stunning courtroom admission, which brought Dugar to tears, was full of emotion, but authorities are far from convinced, according to the New York Post.

Also incarcerated, Smith is serving a 99-year prison sentence for an armed robbery that resulted in a 6-year-old boy being shot in 2008. He recently appealed that sentence, but it was denied, the Post reported, meaning he has nothing to lose by admitting to his brother’s crime and securing his beloved relative’s release from prison.

“He’s got nothing to lose,” Assistant State’s Attorney Carol Rogala told Judge Vincent Gaughan, according to the Tribune, noting that Smith’s confession did not “fit the independent eyewitness accounts of what happened.”

Growing up, the men behaved like “one person,” the Tribune reported, sharing socks, shoes and food. Even now, the paper reported, the brothers look so identical that they can be distinguished only by their prison attire.

By the time the men grew up, they were active gang members who sold drugs and impersonated one another.

“We was acting as one,” Smith told the court, according to the Tribune. “Where I was, he was, acting like each other. He pretended to be me, and I pretended to be him.”

Smith testified that he never admitted to the 2003 killing of Antwan Carter, not even when his brother had been accused of the killing and was preparing for trial, according to the Tribune.

It was not until three years ago, Smith said, that he finally wrote his brother a letter admitting to the crime.

“I have to get it off my chest before it kills me,” Smith wrote, according to the Tribune. “So I’ll just come clean and pray you can forgive me. … I’m the one who shot and killed those two Black Stones on Sheridan that night.”

“The reason I didn’t say [expletive] at the time was because I didn’t and couldn’t find the strength to do so at the time,” he wrote in a second letter.

Smith went on to sign a sworn confession in 2014, the Tribune reported.

If a judge decides Smith’s story is credible, his brother would be given a new trial for the 13-year-old killing, which took place on Chicago’s North Side.

There is one person who has no doubt the men are telling the truth: their mother.

“He wouldn’t lie about that,” Judy Dugar, referring to Smith, told the Tribune.