ROCKLAND, Maine — A 29-year-old Rockland man accused of producing a hallucinogenic drug at a James Street house more than a year ago will face no additional jail time if he stays clean for the next year.

The Maine attorney general’s office reached a plea agreement with Aaron Witt on Tuesday in Knox County Superior Court.

Witt had originally been charged with aggravated trafficking of dimethyltryptamine because the James Street house was within 1,000 feet of a school. The plea agreement reduces the charge to a less serious trafficking offense.

Under the deferred disposition agreement reached Tuesday, Witt will be sentenced to four years in jail with all the time suspended except for the several months he has already spent in jail if he meets terms of the deferral over the next 12 months, said Assistant Attorney General William Savage. Those conditions include 100 hours of community service and restitution to the state of $3,709.

The prosecution approved the deal after Witt agreed to an inpatient substance abuse treatment program, which he has completed.

If there is a violation of the agreement over the next year, there would be no agreement on sentence and Witt could face incarceration.

Witt initially was arrested on Dec. 30, 2011, at the house he rented in Rockland when he called police to report that he suspected someone had broken into the residence. When officers arrived, they found glassware and crushed pills in the kitchen and suspected Witt was manufacturing the psychedelic drug dimethyltryptamine, also known as DMT.

James Pease, Maine Drug Enforcement Agency supervisor, said at the time that the drug is not common in Maine and that agents had dealt with only one other lab, in Bangor, within the last couple of years. The drug can be ingested or smoked, he said.

The Maine Department of Public Safety’s lab team responded and closed off the house and part of the street as members in protective suits scoured the building and removed suspected drug making items.

Witt also was arrested last June for operating under the influence and was sentenced later that month to 10 days in jail.