BANGOR, Maine — A Dexter man scheduled to be tried next month with three others on federal charges in connection with a large marijuana farm in Township 37 in Washington County has entered into a plea agreement with the U.S. Attorney’s Office, according a document filed in U.S. District Court.

Robert “Bobby” Berg, 50, will plead guilty to being an accessory after the fact to manufacturing 1,000 or more marijuana plants. In exchange for his guilty plea, federal prosecutors will drop three counts of harboring illegal aliens, according to the plea agreement dated Thursday.

“Mr. Berg’s plea agreement does not implicate him in the marijuana charge in which he had no involvement,” Berg’s attorney, Richard Berne of Portland, said Saturday in an email. “Nor did he benefit from it in any way. Finally, by agreeing to plead guilty, Mr. Berg is prepared to accept responsibility for his conduct, which is consistent with his character and otherwise unblemished record.”

Berg also waived his right to appeal his case to the 1st U.S. Circuit Court of Appeals in Boston if his sentence is longer than one year and a day. Sentences that long or longer allow inmates to earn good time in the U.S. Bureau of Prisons system.

A date for Berg to enter his guilty plea has not been set. He remains free on $250,000 secured bail.

Berg was scheduled to be tried beginning Jan. 8 with three others in federal court in Bangor.

The plea agreement does not require Berg to testify against his co-defendants. The document was posted Friday on the court’s electronic case filing system. A prosecution version of the offense was not available Friday.

The marijuana farm, which was in operation between Jan. 1, 2006, and Sept. 22, 2009, has been described by police as one of the state’s most sophisticated outdoor marijuana operations, where some 3,000 plants, valued at approximately $9 million, were being cultivated.

It was located in a remote, swampy area surrounded by woods in Washington County, accessible only by all-terrain vehicles or on foot. Because of the charges filed against him, Berg most likely is the man who picked up the workers in a white van around Sept. 29, 2009, about 24 hours after the grow site was raided, and hid them.

Martin Roblero, a 22-year-old undocumented migrant worker, testified at a deposition in May about the operation. He said an unidentified man picked him and other workers up outside the grow site and drove them to a warehouse where they stayed for two days. Roblero said the man gave them food and sweatshirts that had the word “Maine” on them. He testified that the warehouse was full of boxes that contained clothing.

Berg’s business, Berg Sportswear, was searched by federal authorities in January 2011. Court records indicate officials were investigating the Corinna business — which does screenprinting and embroidery — for allegedly using logos of sports teams, distilleries and a motorcycle manufacturer without permission.

No charges related to the illegal use of logos have yet been filed against Berg or the business.

Berg, three other men and a corporation were indicted in September 2012 for being part of a conspiracy to manufacture more than 1,000 or more marijuana plants. Last month, a superseding indictment charged Berg with being an accessory after the fact rather than part of the original conspiracy that planned and oversaw the farm.

Malcolm French, 52, of Enfield, and Rodney Russell, 50, of South Thomaston were indicted in November on the following charges: conspiracy to manufacture 1,000 or more marijuana plants, manufacturing 1,000 or more marijuana plants, maintaining a drug-involved place, harboring illegal aliens and conspiracy to distribute and possess with the intent to distribute marijuana.

Kendall Chase, 57, of Bradford was indicted on charges of conspiracy to manufacture 1,000 or more marijuana plants, manufacturing 1,000 or more marijuana plants, and conspiracy to distribute and possess with intent to distribute marijuana.

Haynes Timberland Inc., the corporation that owns the land where the marijuana plot was discovered by law enforcement in September 2009, also was indicted.

The superseding indictment includes the forfeiture of land owned by French’s firms, including the Township 37 parcel.

Moises Soto, 53, of Nuevo Leon, N.M., who was named in the original indictment, was not named in the new indictment. He pleaded guilty July 30 to being part of a drug conspiracy and harboring an illegal alien.

Had Berg gone to trial and been convicted, he faced up to 15 years in prison and a fine of up to $5 million on the charge to which he pleaded guilty.