A Long Beach man was released from jail today after pleading no contest to trying to sexually assault a 5-year-old girl at a wedding reception.

Jeff Boulter had been behind bars in lieu of $1 million bail since his arrest in May, but if he completes a year of sex-impulse counseling and abides by the terms of his release, he could be spared any further time behind bars, according to authorities.

Boulter, 40, was accused of taking the 5-year-old girl to a dark corner at a May 19 wedding in Valencia before a server noticed what was going on and confronted Boulter, who ran, prosecutors said.

Boulter was originally charged with kidnapping to commit oral copulation, kidnapping for child molesting, kidnapping a victim under 14, a forcible lewd act upon a child, a lewd act upon a child and attempted forcible oral copulation of a victim under 14 years old. The charges could have carried a maximum sentence of life in prison.

Today, however, he pleaded to lesser charges of one felony count of an attempted lewd act upon a child and one misdemeanor count of indecent exposure.

Boulter is scheduled to be officially sentenced on March 18, 2020. If he’s finished 52 weeks of sex-impulse counseling and follows other terms set by the court, he won’t face any more time behind bars, according to the Los Angeles County District Attorney’s office.

If Boulter doesn’t complete the counseling or otherwise runs afoul of the court’s terms, he’ll face four years in prison, authorities said.

City News Service contributed to this report.

Editor’s note: This story has been updated with more information about Boulter’s sentence.

Jeremiah Dobruck is managing editor of the Long Beach Post. Reach him at [email protected] or @jeremiahdobruck on Twitter.