A Clovis man pleaded guilty Monday to conspiring with former Fresno police Deputy Chief Keith Foster to sell heroin – the second defendant to accept a plea deal, but the first to implicate Foster in a widespread drug-trafficking ring.

In announcing his plea, Rafael Guzman Jr. agreed with federal prosecutors that on Dec. 24, 2014, Foster contacted him “to acquire heroin on behalf of a third party.” Guzman then asked Foster what quality of heroin he wanted to purchase.

Be the first to know.

On Dec. 24, 2014, Keith Foster contacted Rafael Guzman ‘to acquire heroin on behalf of a third party,’ according to Guzman’s plea agreement.

On Jan. 8, 2015, Guzman told Foster that “it’s a green light.” Five days later, Guzman told Foster that he needed someone to pick up the heroin for him, and “Keith Foster said he and the defendant should meet and talk in person,” the plea agreement says.

“On February 2, 2015, Keith Foster contacted the third party for whom he was acquiring the heroin,” the plea agreement says. “He/She told Keith Foster the heroin was no longer needed because someone else sold it cheaper than the price Keith Foster was offering to sell the heroin.”

Foster denies taking part in any drug dealing, says his attorney, and has pleaded not guilty to the allegations.

As part of his plea agreement, Guzman, 42, waived his right to a jury trial and right to appeal his pending sentence, which ranges from 46 to 57 months, said Fresno defense lawyer Sal Sciandra, who represents Guzman.

He’s concerned.

Fresno defense lawyer Sal Sciandra’s terse statement while making it clear client Rafael Guzman will not testify against others

But Sciandra made it clear in court Monday that Guzman will not testify against Foster or any other defendant.

Because Guzman will not testify, Guzman’s statements in the plea agreement about Foster cannot be used against Foster because it would be hearsay, Sciandra said.

In accepting the guilty plea, Ishii said he is not bound by the agreement and that before he sentences him, he will consider Guzman’s criminal history and the amount of drugs he was accused of distributing.

It’s unclear how much heroin Guzman had planned to sell Foster, but the plea agreement says Guzman’s relevant conduct for sentencing purposes includes two ounces of heroin, one ounce of methamphetamine and one ounce of cocaine.

Ishii allowed Guzman to remain free until his sentencing on Aug. 15 after federal prosecutors said he has “done well on pre-trial release.”

Notified of Guzman’s plea deal, Foster’s attorney, Marshall Hodgkins, said Monday that Foster denies being involved in drug dealing. “His frame of mind is he will go to trial,” Hodgkins said.

A federal indictment, unsealed April 9, 2015, charges Foster with participating in three separate conspiracies to distribute different controlled substances. Foster, the No. 2 man behind Chief Jerry Dyer, resigned from the Fresno Police Department shortly after his arrest.

Foster is charged with conspiring with co-defendant Randy Flowers to distribute oxycodone, a prescription painkiller that is addictive. Flowers is further charged with being a felon in possession of three firearms. Flowers is Foster’s nephew.

The 13-page indictment also charges Foster and Guzman with conspiring to distribute heroin.

In a third alleged conspiracy, Foster is charged with conspiring with Ricky Reynolds, Jennifer Donabedian, Sarah Ybarra and Denny Foster to distribute marijuana. Denny Foster is also a nephew of Keith Foster.

Reynolds is separately charged with manufacturing marijuana, and both Reynolds and Denny Foster are charged individually in various counts alleging distribution of marijuana. Denny Foster is charged with being a felon in possession of a firearm.

Each defendant is charged with at least one count of using a cellphone in furtherance of a drug trafficking offense. Finally, Denny Foster and Guzman are charged with conspiring to distribute methamphetamine, cocaine and heroin.

Donabedian is Denny Foster’s girlfriend. Ybarra is friends with Donabedian and Denny Foster. It’s unclear how Guzman and Reynolds fit in any of the relationships.

As part of the plea agreement, Guzman pleaded guilty to only conspiracy to distribute and/or possess with intent to distribute heroin. Prosecutors agreed to dismiss the remaining two charges against him.

20 years Rafael Guzman faced in prison if he had been convicted of the federal charges at trial

Guzman accepted the plea deal because he faced up to 20 years in prison and a $1 million fine if he had been convicted of the charges at trial, the plea agreement says. Sciandra said Guzman also accepted the plea deal because he has drug charges pending in Fresno County Superior Court. Prosecutors have agreed to run any prison sentence he receives in Superior Court with his federal prison sentence, Sciandra said.

Foster and the remaining defendants are out of custody. Their next hearing is June 20.

The case has lagged while defense attorneys sift through tens of thousands of pages of documents. The evidence includes transcripts of wiretaps and information from seized electronic devices, prosecutors say.

In November, Ybarra was sentenced to a year in prison for mailing several pounds of marijuana through a package delivery company. Defense lawyer Richard Beshwate, who represented Ybarra, has said she neither knew Keith Foster nor will she have to testify against him.