A former teacher at a private school in Freeport who is accused of allowing his property in Lewiston to be used for selling drugs was allowed to be released Monday, with bail conditions.

Noel Thibodeau, 43, was arrested Aug. 5 on a charge of maintaining a drug-involved premises and was ordered held until being brought to U.S. District Court in Portland for a detention hearing.

Thibodeau is accused of allowing his home at 5 Bradford St. in Lewiston to be used for drug activity from January 2013 to July of this year. If convicted of the felony offense, he will face up to 20 years in prison and a $500,000 fine.

The prosecutor in the case, Assistant U.S. Attorney Julia Lipez, initially sought to have Thibodeau held while the case was pending, but she and Thibodeau’s attorney, Neale Duffett, came to an agreement before the detention hearing on terms under which he could be released.

U.S. Magistrate Judge David Cohen accepted those terms, allowing Thibodeau to be freed on $10,000 unsecured bond with the condition that he live with a family member in Winterport and get substance-abuse and mental health counseling.

Cohen addressed Thibodeau as several members of Thibodeau’s family sat in the courtroom.

“You are very fortunate to have a very supportive family. We don’t often see that here,” Cohen said. “It’s also important that you keep all of this in perspective. The charge against you is a very serious charge, but none of this is the end of the world.”

Cohen advised Thibodeau to use this time to address his addiction. Duffett would not specify the nature of Thibodeau’s addiction.

Thibodeau left the courtroom in the custody of the U.S. Marshals Service and was expected to be released Monday afternoon from the Cumberland County Jail.

Thibodeau was a Spanish and French teacher at Coastal Studies for Girls, a private school near Wolfe’s Neck Farm in Freeport. The boarding school provides semester-long science and leadership programs for high school sophomore girls.

Coastal Studies for Girls issued a statement Thursday saying it does thorough background checks on employees and Thibodeau had no criminal history “and exhibited no signs of engaging in inappropriate behavior of any kind.”

Thibodeau was no longer employed by the school at the time of his arrest, Duffett said.