Twice, a former Wyandanch man hesitated in court Monday when he was asked if he shot a man to death nine years ago. But finally he agreed that he did it.

The admission by Gabriel Hubbard, 23, will allow him to go free soon as part of a plea deal with Suffolk prosecutors. His guilty plea to first-degree manslaughter also prevents his attorneys from further questioning detectives during a pretrial hearing about how they got his signature on a confession — and how those same detectives got a cabdriver who had been shot in an unrelated case to sign an incriminating statement that Nassau internal affairs investigators and others have found improbable.

The detective who wrote both statements, Ronald Tavares, had been testifying at the pretrial hearing.

Hubbard was convicted of second-degree murder in 2012 for the death of Jaquan Jones, but state Supreme Court Justice Martin Efman set aside the verdict because Suffolk prosecutors had not told the defense about concerns with the veracity of the statement signed in 2011 by cabdriver Thomas Moroughan.

Moroughan had been charged with assault after a drunken off-duty Nassau officer shot him in Huntington Station, but prosecutors later dismissed the charge.

Efman ruled prosecutors violated what is known as the Brady rule, which generally requires them to turn over any evidence favorable to defendants as soon as they have it. Prosecutors offered the plea deal last week to Hubbard, just as his attorney was about to resume questioning Tavares.

advertisement | advertise on newsday

The deal calls for Hubbard to be sentenced to the maximum as a juvenile offender, 3 1⁄3 to 10 years in prison. Attorneys expect Hubbard, who has been behind bars for 6 1⁄2 years, to be released soon after state Supreme Court Justice Mark Cohen sentences him on Sept. 30.

Assistant District Attorney Peter Timmons said in court that concerns about the strength of the case had nothing to do with why his office offered the deal.

“The offer was not being made to avoid further cross-examination of Det. Tavares or any other police officers,” he said, adding that he was confident the confession would have been ruled admissible at trial.

Defense attorney JoAnn Squillace, who advised Hubbard not to take the deal, said that made no sense.

“This is no vindication for the detectives,” she said. “They came to us, in the middle of cross-examination. It’s very rare that a district attorney would reduce a murder to manslaughter and allow someone to get out of prison after just 6 1⁄2 years.”

During the plea proceeding, Hubbard balked twice when Cohen and then Timmons asked if he was pleading guilty because he was guilty. But he ultimately said he was, and answered “yes” when Timmons asked if he had shot at a house on July 5, 2008, killing Jones. Hubbard waived his right to appeal the case.

In addition to Tavares, several homicide prosecutors watched Hubbard plead guilty. They included Raphael Pearl, who both won the conviction that was overturned and handled the Moroughan case.

The victim’s father, John Jones, said he was glad the case is finally ending.

advertisement | advertise on newsday

“We were confident all along this kid was the guy who did it,” Jones said tearfully, as he held Tavares’ hand. “It was eating him up. It ate me up.”

Tavares declined to discuss either statement. “It’s a day of reflection for Mr. Jones,” he said.

Hubbard’s mother, Theresa Davison, said she’d been conflicted about whether her son should say he did something he says he didn’t do, but said she’d be happy to see him free.

“He did what he had to do,” she said.

Squillace said the plea satisfied no one.

advertisement | advertise on newsday

“I think today was a very difficult day for everybody,” she said.

The only good to come out of it, she said, is that it may allow her client to pursue his dream of being an architect.

“He’s a very bright and ambitious young man,” she said.