Born a woman, Beatie had his breasts surgically removed and legally became a man later in life, though his vagina remained intact. After Beatie learned his wife Nancy would not be able to bear children, the couple decided to impregnate Beatie with donated sperm, making him the first man to ever give birth.

"Parties have failed to show that the word 'man' in the state constitution means anything different from its plain, ordinary meaning, which by any generally accepted definition or reputable dictionary excludes people capable of giving birth," Gerlach wrote, dismissing the case for a lack of subject matter jurisdiction, ABC News reported.

Beatie says he will appeal the judge's decision.

"Imagine what this is doing to my children," Beatie told reporters. "In time, they are going to look back and see that a court said that's not your daddy. I'm sorry, that's who I am. I am my children's father."

Beatie said the ruling was discriminatory towards transgender people.

"This obviously is not Beatie versus Beatie. This is the state of Arizona versus transgender people, human reproductive rights and fairness under law," he said.

Beatie legally married his wife Nancy in Hawaii in 2003, after presenting legal documentation that identifies him as a man. The couple had their first child in July of 2008.

While the judge's ruling means Beatie doesn't have to pay alimony, he reportedly feels frustrated as he tries to move on with his girlfriend Amber.

"It's hard for him. He feels he is being targeted," Beatie's attorney David Cantor said.

Nancy Beatie's attorney, David Higgins, told ABC News that she would likely join the fight against the judge's ruling.

"The decision is a two-edged sword for Nancy," Higgins said. "Obviously she is very disappointed the judge did not find the marriage to be valid. She understood herself to be married, believed Thomas to be a man, and we will probably join Thomas in moving forward with an appeal in that regard."