PORTLAND, Maine — A Norridgewock man was sentenced Tuesday in U.S. District Court to 10 years in prison for bringing cocaine into the state from Massachusetts and having a gun when he was transporting the drug.

William DeGraff Jr., 35, pleaded guilty June 3 to conspiracy to distribute 500 grams or more of cocaine or cocaine base, possession with intent to distribute cocaine and possession of a firearm in furtherance of a drug crime.

DeGraff faced between five and 40 years on the conspiracy count and up to 20 years on the possession count. On the gun charge, DeGraff faced a mandatory minimum sentence of five years that he will serve after completing his sentence on the drug charges.

U.S. District Judge George Singal sentenced DeGraff to two five-year terms on the conspiracy and drug charges, to be served concurrently, and five years on the gun charge, to be served consecutively.

In addition to prison time, Singal sentenced DeGraff to four years of supervised release. DeGraff also faced fines of up to $2 million. The judge did not impose a fine.

DeGraff’s attorney, Robert Ruffner of Portland, said in a telephone interview after the sentencing that his client had no prior criminal record.

Assistant U.S. Attorney Daniel Perry disagreed. He said in a telephone interview after the hearing that DeGraff had a state conviction for cultivating marijuana.

Details about the crime were not available late Tuesday.

DeGraff was at a low point when he began selling cocaine 3½ years ago, his defense attorney said.

“He lost his job that he’d had for more than 11 years at a shoe factory and his house burned twice,” Ruffner said.

Piotr Krajewski, 38, of Madison and DeGraff purchased cocaine and cocaine base from March 2008 to February 2011 from Jorge Delmonte, 40, of Methuen, Mass., according to the prosecution version of events to which DeGraff pleaded guilty.

Delmonte was sentenced Sept. 27 in federal court in Portland to nine years in prison on the conspiracy charge to which his co-defendants also pleaded guilty. Delmonte, a native of the Dominican Republic, is expected to be deported after completing his prison term.

Krajewski is scheduled to be sentenced Wednesday afternoon in federal court in Portland on the conspiracy charge.