in 2008 and had two more by 2011.

By then, he and his wife had moved to Arizona. When their marriage fell apart, and Beatie wanted to marry another woman, they petitioned for an uncontested divorce.

But in March 2013, Maricopa County Superior Court Judge Douglas Gerlach ruled that Beatie's marriage was between two females because Beatie had given birth. Same-sex marriage is illegal in Arizona.

In one of his rulings, Gerlach wrote that Beatie's "marriage was between a female ... and a person capable of giving birth, who later did so."

Wednesday's ruling, however, noted that Arizona law also permits people who have had gender reassignment to alter their birth certificates and legally change gender. In fact, according to the opinion, Arizona's law on the matter is more "liberal" than Hawaii'sin what evidence must be presented to amend the birth certificate.

"The question before this Court is not whether the State of Arizona allows same-sex marriage or divorce, but whether the laws of the State of Arizona allow a marriage, lawfully entered into in another state, between two persons the foreign state formally recognized at the time of the marriage as male and female, to be dissolved," the appellate decision said.

"At the time of the Beaties' marriage in Hawaii, that state only allowed marriages between a man and a woman, and Hawaii's legislature, like Arizona's, had established statutory authority allowing persons who had undergone a sex change operation to apply for and obtain an amended birth certificate reflecting the appropriate gender."

Beatie and his wife may go ahead with divorce