FARMINGTON, Maine — A Jay man pleaded guilty Wednesday to committing unlawful sexual contact against a child under age 12 in August 2010.

Ralph O. Metcalf, 34, had been indicted on a charge of gross sexual assault. His trial, which was expected to last two days, was based on that charge.

A jury had heard opening statements from Assistant District Attorney James Andrews and defense lawyer Peter Kaynor prior to Justice Michaela Murphy calling for a recess at Franklin County Superior Court. Jurors went to the jury room.

After discussions with lawyers in the courtroom and in chambers, a plea deal was reached. Metcalf pleaded guilty to a lesser sex charge while the jury was still out of the courtroom.

The higher felony was dismissed. It had carried a penalty of up to 30 years in prison.

A conviction on the lesser charge of unlawful sexual contact carries up to 10 years in prison.

Sentencing was postponed until after June 25.

The recommendation will be for Metcalf to serve five years of a 10-year sentence at the Maine Department of Corrections, Andrews said. Metcalf could serve 12 years of probation once he is released, the prosecutor said.

Metcalf also would be required to be a lifetime registrant of the Sex Offender Registration and Notification Act.

Andrews said the mother of the victim became frustrated with the length of time it was taking to resolve the case. New information came to light during the process.

The mother and the victim wanted the case dismissed, he said.

Andrews said he was told recently that the mother and the victim were talking about taking the Fifth Amendment and not testifying.

“They have wanted the case dismissed for a while,” he said. “They are here only by the power of a subpoena.”

The only reason Murphy was willing to accept the plea agreement, she said, was because the family wanted the case dismissed and the victim said she would take the Fifth Amendment and not testify.

Murphy revoked Metcalf’s bail and he was taken to the Franklin County Detention Center.