BUFFALO, N.Y. — A New York prison artist who never played golf but became known for drawings of lush courses he could only imagine was set free Wednesday after authorities agreed that another man committed the murder that put him behind bars for nearly three decades.

Valentino Dixon walked out of Erie County Court into bright sunshine and hugs from his mother, daughter and a crowd of other relatives and friends, ready for a meal at Red Lobster and vowing to fight on behalf of others who are wrongly convicted.

"I love y'all," Dixon shouted after trading the green prison uniform he wore in court for jeans and a T-shirt. "It feels great."

Earlier Wednesday, a judge agreed to set aside Dixon's conviction in the 1991 shooting death of 17-year-old Torriano Jackson on a Buffalo street corner and accepted a guilty plea from another man who had confessed to the killing two days after it happened.

"There was a fight. Shots were fired. I grabbed the gun from under the bench, switched it to automatic, all the bullets shot out. Unfortunately, Torriano ended up dying," Lamarr Scott, who has been in prison for 25 years for an unrelated attempted murder, told the court. "I dropped the gun and ran and it was over and done with."

Scott said he had gotten the gun, a Tec-9 semi-automatic, from Dixon and the two men had driven together to the crowded corner where the fighting broke out. Scott was given a sentence of 8 1/3 to 25 years in prison, concurrent with his current term.

Judge Susan Eagan let stand a count of criminal possession of a weapon against Dixon, and its 5- to 15-year sentence, which she said he had satisfied.

"You are eligible for release today," the judge said, igniting applause and shouts from courtroom supporters.

"Mr. Dixon is not an innocent man. Don't be misguided in that at all," Erie County District Attorney John Flynn told reporters after the hearing. He described Dixon as "an up-and-coming drug dealer in the city of Buffalo" at the time of the shooting and said Scott was Dixon's bodyguard.

Family and friends cheered when the judge, after accepting a guilty plea from another man who confessed to the shooting, ordered Dixon's release. Carolyn Thompson / AP

"Mr. Dixon is innocent of the shooting and of the murder for what he was found guilty of," he said, "but Mr. Dixon brought the gun to the fight. It was Mr. Dixon's gun."

While behind bars, Dixon rekindled his childhood passion for drawing, often spending 10 hours a day creating vivid colored pencil landscapes, including of golf courses, while imagining freedom. Articles in Golf Digest and elsewhere have drawn public attention to Dixon's case, as well as a documentary produced by Georgetown University students as part of a prison reform course last spring.

The class worked with Dixon's attorney, Donald Thompson, to have the conviction overturned.

"It went so far beyond reasonable doubt that it's pretty outrageous that he would have been convicted and it would have been upheld," said Marc Howard, director of the university's Prisons and Justice Initiative. Howard taught the course with childhood friend, Marty Tankleff, who also spent years wrongfully imprisoned.

Dixon said he will keep drawing, while working on behalf of other prisoners.

"If you don't have any money in this system, it's hard to get justice because the system is not equipped or designed to give a poor person a fair trial," he said. "So we have a lot of work ahead of us."

His daughter, Valentina Dixon, was a baby when her father went to prison. She brought her 14-month-old twins, Ava and Levi, to court from their Columbus, Ohio, home.

"We're definitely going to go shopping and go explore life," she said. "I can't wait to get him a cellphone and teach him how to Snapchat."

Dixon's mother, Barbara Dixon, said she was in shock after relying on her faith while fighting for his release.

"We're going to Red Lobster," she said when asked what was next. "And everybody's invited."