The Brooklyn district attorney's office launched an investigation in January and concluded after 10 months that their confessions were false and that there was no evidence linking the teens to the crime.
D'Emic overturned the verdicts after Brooklyn District Attorney Ken Thompson asked the Brooklyn Supreme Court to vacate the sentences and free McCallum.
Stuckey died in prison. His mother sat next to McCallum in court, gripping his hand and comforting him as the judge overturned the indictment.
She later left the court in tears, refusing to talk to the media.
Since Thompson took up his post in January, dozens of cases - mainly homicides - are being reviewed by a special unit headed by a Harvard law professor.
The unit's investigation had concluded that the confessions by McCallum and Stuckey were "false and not supported by physical or testimonial evidence", Thompson said.
So far, the unit's investigations have led to the vacation of nine convictions, while 17 others have been deemed valid.
McCallum, dressed in a white shirt, beige jacket and khaki pants, emerged from court with a smile and hugged his overjoyed family.
"I feel like I want to go home, finally," he told reporters, admitting that he had at times lost hope of being freed.
"I'm very, very happy but I'm very, very sad at the same time," he said, adding he wished that Stuckey were walking free with him.
His first wish was to walk on the footpath, and then go home and enjoy his mother's cooking, he said. He had no special requests, saying that after 29 years of prison food, anything would be wonderful.
His mother Ernestine, who rushed to embrace her son in the corridor, said she had been late because she was baking cakes and cooking her son's homecoming dinner.
"I kept praying and hoping for this day to come," she said.
- AAP