HARRISBURG — When news spread three years ago that Rob McCord, Pennsylvania's onetime state treasurer, wore an FBI recorder in hope of exposing a pay-to-play culture in Harrisburg, it sent a chill through the Capitol.

McCord had been caught illegally shaking down potential donors, and prosecutors were eager to use him as bait to lure others into the trap of an ambitious public corruption probe.

But McCord's brief turn as a government cooperator instead ended in a spectacular debacle, one that cut short the only case the treasurer helped to build that resulted in a trial.

Now, as McCord prepares to be sentenced Tuesday before U.S. District Judge John E. Jones III for his own crimes, what exactly his cooperation delivered and how happy prosecutors were with his performance could become the defining factors in whether he will receive jail time.

McCord faces a range of 57 to 71 months in prison under federal guidelines, according to recent court filings. He could receive far less if federal prosecutors advocate for him to receive credit for his assistance in the probe. Last week, they declined to comment on whether they will do so.

McCord's lawyer, Robert E. Welsh Jr., said he will ask the judge to consider his lengthy public service. McCord, he said, has tried to lead a productive life since his political downfall, taking classes and working as an occasional yoga instructor in North Carolina, where he now lives.

"We're going to demonstrate that he is committed to serving other people," Welsh said last week. "What motivated him to get into public service was really public service. That's not to say that justifies his actions here, but the law is such that the judge has to consider every factor of his background."

That background is fraught.

Before his world came crashing down, McCord, a onetime Democrat from Montgomery County, boasted the kind of political resumé that could have propelled him to higher office. A Harvard University graduate with a background in high finance, he was elected state treasurer in 2008 and quickly made a name for himself as a forward-thinking, fast-talking elected official fluent in the worlds of both venture capitalism and politics.

Though he could be aggressive, he also possessed a people-person streak that made him accessible and likable. It was little surprise when he threw his name into the governor's race in 2014.

The race ended in his political undoing. Facing a crowded field in the Democratic primary — among the candidates a wealthy, self-funded opponent, Tom Wolf, who ultimately snagged the nomination and became governor — McCord became desperate in his quest to raise campaign cash. And then he became reckless.

What he didn't know was that federal agents were secretly recording his conversations as part of a sweeping pay-to-play investigation in the Capitol that, unbeknownst to anyone in political circles, had already ensnared John H. Estey, onetime chief of staff to Gov. Ed Rendell. Estey, who had surreptitiously agreed to wear a recording device, led federal authorities to McCord.

In 2015, McCord abruptly resigned his post, and later pleaded guilty to attempting to strong-arm  campaign donors in an effort to bolster his flagging campaign. His cooperation with federal authorities led to further charges in the sweeping probe, including against former Treasurer Barbara Hafer and Chester County businessman Richard Ireland, a little-known but wealthy donor and fund-raiser whom McCord had secretly recorded in late 2014.

Prosecutors accused Ireland of attempting to bribe McCord through campaign donations, as well as a job in the private sector, in exchange for the then-treasurer's help in landing multimillion-dollar state contracts. To prove their case, federal authorities needed to show that there was an explicit quid pro quo between McCord and Ireland.

But in his turn as the star witness at Ireland's trial last year, McCord turned out to be a defensive and unpredictable witness. He painted a deeply cynical portrait of how business sometimes gets done in Harrisburg, testifying at one point: "This is a weird business. You say, 'You lie down with dogs, get up with fleas' – but you have to lie down, in a sense, with anybody in the commonwealth of Pennsylvania to get stuff done."

But he also came off as too talkative and too willing to make excuses — including for his own crimes.

Under cross-examination by Ireland's lawyer, Reid Weingarten, McCord admitted he had to be convinced that he did something wrong. He told the jury that he had read a book called Three Felonies a Day, by Harvey A. Silverglate, which "convinced me absolutely that you could be committing not just a crime, but a felony, without intending to hurt anybody, without intending to even cross the chalk lines. And I thought, I'm one of those people."

Then McCord, still under cross-examination, said he never believed that his dealings with Ireland involved a quid pro quo relationship.

That delivered a devastating blow to a case that relied upon McCord's admitting plainly that what he and Ireland were discussing was a bribe. The former treasurer's equivocation caused such heartburn among prosecutors that Assistant U.S. Attorney Michael Consiglio later turned on his own witness — launching a string of questions about additional quid pro quo arrangements that McCord had been caught on tape discussing with other potential donors.

Although McCord was never charged with crimes in connection with those additional dealings, prosecutors could urge Jones to consider them as he crafts the former treasurer's sentence next week.

One of those alleged arrangements involved a potential donor Consiglio described only as a prominent Republican donor with business interests in the "education marketplace." Though the man was never identified in court, Consiglio detailed McCord's purported hustle in a sidebar conversation with Jones during Ireland's trial — a transcript of which was obtained by the Inquirer and Daily News.

It happened in late 2013, when McCord was surreptitiously being recorded by Estey, who was purporting to help McCord raise cash for his gubernatorial campaign.

"The deal was, Rob McCord would, if he was elected governor, fire three people from the Department of Education," Consiglio said.

The initial discussion was to exchange the firings for a campaign donation of $25,000.  But, the prosecutor said, McCord put a bigger price tag on the deal.

"When the price came up, the donor said $25,000," Consiglio recounted. "Rob McCord countered and said,  'For that kind of ask, it's a hundred thousand.'"

Campaign finance records show that Estey, through a campaign PAC, received just two donations that year, both of which he then donated to McCord’s campaign. One was from a Pittsburgh nursing-home owner for $100,000. The second, for $25,000, came from a PAC associated with Vahan H. and Danielle Gureghian. Vahan Gureghian is a Montgomery County lawyer and charter-school magnate known as one of the state’s biggest GOP donors.

The nursing-home executive, Ross Nese, has repeatedly declined comment. Gureghian's lawyer, H. Marc Tepper of Buchanan Ingersoll & Rooney, said in a letter last week that his client had "not been involved in any wrongdoing, nor has he been charged with any criminal offense."

McCord described parts of that deal on the witness stand under prompting from Consiglio and eventually revised his earlier answers to admit that he had engaged in quid pro quo behavior. But that reversal came too late to salvage the government's case against Ireland.

As soon as prosecutors rested their case, and before Ireland's lawyer could begin putting on their defense for the jury, Jones dismissed all 79 counts Ireland faced, saying that the government had failed to show there was an explicit agreement between Ireland and McCord to swap donations for state contracts. It was McCord's own testimony, Jones noted, that helped doom the case.

Neither McCord nor another important witness in the case "performed as the government hoped they would," the judge said. "They were the clear foundation of the government's case going into this trial, and their collapse left the government in an untenable position scrambling to cobble together an alternative theory. This was ultimately an impossible task."

Come Tuesday, McCord will find out just how much prosecutors plan to hold that collapse against him.

Staff writer Craig R. McCoy contributed to this article.