AUGUSTA – A Fairfield man who almost succeeded in getting out of jail earlier this month by impersonating a soon-to-be released inmate was ordered to serve nine months for that and two other offenses.

William Joseph McLain Jr., 29, pleaded guilty Tuesday in Kennebec County Superior Court to forgery — signing the other inmate’s name in a jail release book July 1 — and to earlier charges of operating after revocation and failure to appear.

McLain had been on trial in Kennebec County Superior Court on April 28, 2010, on the operating-after-revocation charge. While officials were trying to track down a witness, he stepped out, allegedly for a cigarette, and kept going.

The trial was halted, the jury excused and McLain was charged with failure to appear for jury trial.

He was arrested on warrants in June.

Then, on July 1, he tried to switch identities with another inmate who was due to be released. He had changed into the other man’s clothes before the impersonation was foiled.

On Tuesday, McLain was in custody, wearing a jail uniform.

He pleaded guilty to the Aug. 20, 2009, driving violation in Benton; and to the April 28, 2010, charge of failing to appear for a jury trial.

Along with the nine-month jail sentence, McLain was ordered to pay a $1,000 fine.

McLain’s attorney, David Geller, said McLain hopes to get into a special jail program, Kennebec County’s Criminogenic Addiction Recovery Academy, which helps inmates avoid returning to criminal behavior.