MACHIAS, Maine — Former Washington County Sheriff Donnie Smith, who had been scheduled for a jury trial to begin Friday on misdemeanor charges of harassment by telephone or electronic communication device, has agreed to pay a $250 court filing fee as part of an agreement with the district attorney.

If Smith stays out of trouble for a year, the charges will be dismissed, Washington County District Attorney Matthew Foster said Thursday.

Smith did not admit guilt and is not required to go to counseling or perform any other specific duties as part of the agreement, Foster said.

“Basically, he has to stay out of our hair [for the next year],” Foster said. “If we have any concerns about anything, we can bring the case back.”

Smith was charged with two counts of harassment by telephone for sending text messages Jan. 1 that were “offensively coarse or obscene” to two sheriff’s department employees, according to court documents.

Smith lost his re-election bid to Barry Curtis in November, and his last day in office was Dec. 31, 2014.

Smith still is scheduled to appear in Machias District Court on July 16 on misdemeanor charges of reckless conduct and driving to endanger, according to court documents. These charges stem from an alleged confrontation on the road on Jan. 6 in Lubec with a woman he had previously accused of assaulting him.

In addition, Smith was indicted Monday on three felony charges of theft by unauthorized taking, theft by misapplication of funds and misuse of entrusted property in connection with the use of funds from an inmate benefit account at the Washington County Jail.

Smith is scheduled to appear for an arraignment on the indictment charges on Monday, June 22, in Washington County Superior Court.