Michael Jackson's ex-wife once made it clear she wanted him to have sole custody of their two children, but an appellate court has ruled that her parental rights were not properly relinquished under the law.

The decision Wednesday was a victory for Deborah Rowe in her battle over the children, setting the stage the stage for further litigation.

"A court cannot enter a judgment terminating parental rights based solely upon the parties' stipulation that the child's mother or father relinquishes those rights," the appeals court said.

The pop star, who has been living out of the country since his acquittal on molestation charges last June, could appeal the ruling. He is reportedly traveling with his children in Italy.

Lawyers for Jackson and Rowe did not immediately return calls for comment Wednesday.

Jackson and Rowe married in November 1996 and filed for divorce in October 1999 after the births of son Prince Michael and a daughter, Paris. Jackson also has another son, Prince Michael II, whose mother hasn't been identified.

Rowe gave up custody in an October 2001 court proceeding in which she said she was willing to do so "because Michael is a wonderful man ... a brilliant father."

"These are his children. I had the children for him," she said at the time. "They wouldn't be on this planet if it wasn't for my love of him. I did it for him to become a father. Not for me to become a mother. You earn the title parent. I have done absolutely nothing to earn that title."

A judge voided the order at her request in 2004 after her attorneys argued that proper court procedures weren't followed, according to court records.

She cited publicity surrounding Jackson's prosecution on child molestation charges and press reports that he was associating with the Nation of Islam as reasons for the decision.

"Because she is Jewish, Deborah feared the children might be mistreated if Michael continued his association with the Nation of Islam," the ruling noted.

Loyola Law School professor Laurie Levenson said in an interview that Wednesday's ruling puts Rowe back in the position she was in before she relinquished her parental rights. If the case returns to court, she said, state agencies would probably be asked to evaluate the situation.

"No court has ever really figured out what would be best for these kids," she said.