Discuss as:

Man pleads guilty to attempted bigamy after wives' Facebook encounter

A Washington state jailer whose wife discovered through Facebook that he had married a second woman has pleaded guilty to attempted bigamy.

Alan O'Neill, 42, of Graham, was charged in March after his first wife learned of his second wife through a Facebook "people you may know" notification and alerted authorities.

The second woman's profile photo showed her with O'Neill, dressed up and standing near a wedding cake, The Tacoma News Tribune reported Friday.

O'Neill, who was accompanied to court Thursday by the second woman, told Superior Court Judge Beverly Grant he never meant to commit a crime.

"I've never done anything intentionally wrong in my life," he said.

O'Neill was spared jail time but will be on probation for a year. The charge is a gross misdemeanor.

Watch US News videos on NBCNews.com

He has annulled his second marriage and is divorcing his first wife.

O’Neill married his first wife in 2001, when he was known as Alan Fulk, The News Tribune reported in March. The couple split up eight years later, but the pair never divorced, the newspaper reported. Last December, he reportedly petitioned to have his name changed to O’Neill before marrying his second wife.

O'Neill's first wife seems to have forgiven him. She wrote a letter of support, saying that the media coverage has been enough punishment.

Related: Man charged with bigamy after wives' Facebook encounter

"He just made a bad decision that hurt a few people's feelings and (brought) embarrassment to himself," she wrote.

O'Neill's lawyer, Philip Thornton, told the judge his client tried to get a divorce from his first wife before he married the second one. O'Neill trusted a neighbor to process his divorce through Lincoln County, but the neighbor didn't file the paperwork, Thornton said.

Stay informed with the latest headlines; sign up for our newsletter

"Mr. O'Neill failed to follow through on that," Thornton said. "He is extremely embarrassed and remorseful."

O'Neill's future as a Pierce County corrections officer remains in question.

He is on unpaid leave. Sheriff Paul Pastor, who oversees the jail, will evaluate the results of an internal affairs investigation before deciding whether to allow O'Neill, on the job for five years, to come back to work, sheriff's spokesman Ed Troyer said.

This article includes reporting by The Associated Press.

More content from NBCNews.com:

Follow US News from NBCNews.com on Twitter and Facebook