PITTSBURGH—A man wrongly incarcerated for 19 years in a 1986 rape who was later exonerated by a DNA test is headed back to prison on gun and drug charges.

Thomas Doswell, 54, of Pittsburgh, was sentenced Thursday to 11 1/2 to 23 months in the county jail. Doswell had previously pleaded guilty to possessing marijuana, crack cocaine and a gun, which police found in August when they stopped him as a material witness to a murder. Doswell can't legally possess a gun because of a 30-year-old robbery conviction.

Allegheny County Judge Anthony Mariani told Doswell he didn't deserve another chance.

"You sat in a cage for 18 or 19 years for something you didn't do," the judge told Doswell, noting if that prison time "didn't persuade you to not commit these offenses, I don't know what does."

Doswell was freed in 2005 after the DNA test showed someone else had raped his accuser.

Doswell sued the city and won $3.8 million after claiming a photo lineup was tainted because his mug shot was marked with an "R" when the accuser identified him. At that time, police routinely marked rape suspects' pictures with that letter, and the picture of Doswell, who had a prior rape arrest but not a conviction, was the only one in the photo lineup with such a mark.

Since his release, Doswell also pleaded guilty to unlawful restraint and reckless endangerment in 2007, after he was accused of speeding off with a 17-year-old girl he'd picked up at a bus stop. He was sentenced to two years' probation and 300 hours of community service.

Defense attorney James DePasquale said the judge was lenient given Doswell's criminal history.

DePasquale said he's encouraged Doswell to enter a drug treatment program, and the judge said he may consider a petition for early release after 90 days if Doswell gives him reason. But Judge Mariani warned he'll send Doswell back to state prison for 10 years if Doswell fails a drug test or gets into more trouble during the three-year probation term that will follow his jail sentence.

"Mr. Doswell had been told by me, not once, not twice, not five times, not 10 times, probably 100 times since he was released from prison that he could not be anywhere near a gun and he should not be anywhere near drugs, and he gets arrested with a gun and drugs," DePasquale said. "He has no one but himself to blame."