LOCKPORT – Ryan S. Smith, a Niagara Falls man whose conviction for three violent crimes was overturned because police used a Taser on him to obtain a DNA sample, was sentenced Tuesday to eight years in state prison. He already has served more than half of that time awaiting trial.

Smith, 25, pleaded guilty in March to all 24 counts of the original indictment in exchange for a pledge from Niagara County Judge Sara Sheldon Farkas that she would sentence him to no more than eight years.

Smith originally was sentenced to 45 years after a jury convicted him in 2009 of three sets of felonies from 2006: two home invasions, one of which included the shooting of a man, and the armed robbery of a convenience store at a gas station.

However, the Appellate Division of State Supreme Court overturned the conviction in March 2012 because police used a 50,000-volt blast from an electronic stun gun to compel Smith to give a DNA sample in September 2008. Smith was in handcuffs and sitting on the floor of Niagara Falls Police Headquarters at the time.

He had given a DNA sample the previous month without incident, but the sample was spoiled by a laboratory worker’s error, and Farkas, without telling the defense, authorized the collection of another sample. The situation was apparently not explained to Smith when he was picked up again.

“I’m guilty. It is what it is,” Smith said Tuesday. “My whole goal all the time was to get home to my family, not to fight in court. I got eight, so I think it’s a blessing on my behalf … I came from 45 to where I should have been.”

“In a strange, perverse way, he’s added to the body of law we have in New York,” said court-appointed defense attorney Joseph Terranova, who worked out the plea deal despite Smith’s frequent attempts to fire him.

“The crimes in this indictment are horrific,” said special prosecutor Paul C. Parisi, an Erie County assistant district attorney who took over the case following the appellate court’s ruling,

In the armed home invasions during the summer of 2006, Smith and others bound up children with duct tape, while in the Christmas Eve gas station robbery, a clerk was pistol-whipped, and Smith pointed a gun at police who were chasing him.

“This is who this defendant is,” Parisi said.

“This may have reflected who Mr. Smith was at one time. That’s irrelevant at this point,” Terranova said. “I feel Mr. Smith has a tremendous amount of potential. He’s actually quite bright.”

“I don’t know exactly where I’m going, but I’m hoping for better days,” Smith said.

“So you have no interest in being a productive member of society?” Farkas asked.

“That’s not what I said,” Smith replied.

“My concern is that you’re going to be back here, and someone’s going to get hurt in the process,” the judge answered.

“That’s your personal opinion,” Smith said. “I’m not sorry, but I apologize … I don’t know where I’m going, but I’ll get there when I get there.”