A sexual assault charge against a former Oakland man who spent almost eight months in jail while awaiting trial was dismissed Wednesday in a move that his attorney said was “totally unexpected.”

Joshua Adams Smith, 43, was indicted in June 2016 by a Kennebec County grand jury on a charge of gross sexual assault that allegedly occurred April 5, 2016, in Oakland. The indictment said the victim was under 18.

“I am pleased with the outcome,” said Smith’s attorney, Stephen C. Smith, who is not related to the defendant. “My client has steadfastly maintained his innocence and rejected all plea offers. We were prepared for trial. While I appreciate that the state was able to re-evaluate their case, there is no way for my client to regain the eight months of his life he spent behind bars waiting for trial.”

Joshua Smith is heading out of state now that he’s free, his attorney said, adding, “I’m sure he does not have pleasant memories of Maine.” Joshua Smith was employed in California and was extradited to Maine to face the charge.

Smith, the attorney said, had rejected two plea deals in December 2016 that would have kept him behind bars for four or five years, respectively, and required him to register as a lifetime sex offender.

The file at the Capital Judicial Center shows that the prosecution reported learning that “a key piece of evidence” was located in February, so the case was moved off that month’s trial list.

Smith’s attorney said his records show that on Feb. 6, Oakland police submitted a paper bag of sheets from the victim’s bed, and those were submitted for a general forensic chemistry analysis.

“Shortly after that happened, the police obtained a warrant to get my client’s DNA using a cheek swab at the jail,” Smith said. “He gave them that sample. And on the eve of trial, they dismissed the case.”

The defendant was freed shortly afterward with no conditions.

He had been held at the Kennebec County jail in lieu of $500,000 bail, which was set in late August 2016, with conditions prohibiting him from contact with the victim, her family members and with girls under 18.

The prosecutor filing the dismissal, Assistant Attorney General Michael Madigan, wrote that it was for “prosecutorial discretion” and “without prejudice,” meaning the charge could be brought back at some point.

Kennebec County District Attorney Maeghan Maloney said Thursday via email: “After review of the forensic evidence, the state is not able to prove the case beyond a reasonable doubt.”

Betty Adams can be contacted at 621-5631 or at:

[email protected]

Twitter: @betadams