A California appeals court reverses a trial judge who wouldn't allow Patric as sperm donor to have any relationship with his in vitro son.

Jason Patric scored a huge victory at a California appeals court on Wednesday. The actor has overcome significant odds and established the right to claim parentage of his 4-year-old son Gus, who was born through artificial insemination.

The custody dispute, which received national press attention, is between Patric and ex-girlfriend Danielle Schreiber. Thanks to California law, which grants the mother full custody unless there is a written agreement establishing parental rights before conception, a Los Angeles Superior Court judge denied The Lost Boys star access to his son. But according to today's decision, California appeals court judge Thomas Willhite says that the presumption against in vitro fathers shouldn't be "so categorical," and that the family law code "does not preclude a donor from establishing that he is a presumed father."

STORY: Jason Patric's Sperm Spawns First Amendment Battle

When Patric and Schreiber were dating almost a decade ago, the two tried to have a baby together. They soon learned that natural conception would be difficult.

In 2008, Patric gave Schreiber a letter in which he wrote that he was not ready to be a father, but that if Schreiber wanted to use his sperm to conceive, she had his blessing as long as she didn't tell others.

On the informed consent forms required as Schreiber prepared for the in-vitro fertilization, she filled out both her name and Patric's in the spaces designated for "intended parent." The procedure was successful. Gus was born in December 2009.

Although Patric might not have been ready at first to be a father, he says he developed a relationship with his newborn son. When the actor was working in New York, Schreiber and Gus would stay with him at his apartment there. When they weren't there, Patric communicated with Gus via Skype.

But in 2012, Patric's contact with Gus was cut off when Schreiber terminated her relationship with Patric.

In court, Schreiber attempted to foreclose any custody, and the judge applied the holding of a 2005 California appellate case (Steven S. v. Deborah D.) to give the mother a win over her sperm donor.

"I don’t think anyone is going to prevail as a result of this," said the trial judge reluctantly at the time. "I think at the end of the day that everyone turns out to be worse off, and certainly I think Gus turns out to be worse off as a result of where we’re going to end up. But it just is what it is, because I think that’s the legislative policy that’s been articulated.”

STORY: Judge Won't Stop Jason Patric from Using Son's Name for Advocacy Purposes

Patric appealed the decision, which led to today's opinion (read in full here).

Appellate judge Willhite says that the only issue decided in that 2005 case was whether the statute at issue -- 7613(b) -- applied when the sperm donor was an intimate friend and sexual partner of the mother. But there are other scenarios, including a couple that is purposefully attempting to have a child together. And the appeals court judge today acknowledges that the prior ruling might have been too categorical, pointing to another case (K.M. v. E.G) decided also in 2005 by the California Supreme Court that dealt with a lesbian couple living together with the intention of bringing a child into a joint home. California might have set up its law so that woman could get sperm without fear of a paternity claim and so that men could give sperm without fear of paying child support, but the California Supreme Court held in that 2005 case that "there is nothing to indicate that California intended to expand the reach of this provision so far that it would apply if a man provided semen to be used to impregnate his unmarried partner in order to produce a child that would be raised in their joint home."

Today's ruling is a follow-up of sorts and confirmation of that statement.

"We conclude the trial court’s ruling was incorrect," writes Judge Willhite. "Instead, we hold that section 7613(b) should be interpreted only to preclude a sperm donor from establishing paternity based upon his biological connection to the child, and does not preclude him from establishing that he is a presumed parent under section 7611(d) based upon post-birth conduct."

The ruling goes on to say that "a sperm donor who has established a familial relationship with the child, and has demonstrated a commitment to the child and the child’s welfare, can be found to be a presumed parent even though he could not establish paternity based upon his biological connection to the child."

The case is now remanded back to the trial court. Some direction to the judge there is given. The law requires some demonstration of a "familial relationship," and if Patric attempts to show his connections with Gus, Schreiber will be allowed to rebut. According to today's opinion, "In this case, Jason was denied the opportunity to present evidence to show that he is Gus’s presumed father."

The ruling is the second legal victory in as many weeks for Patric. Late last month, a judge denied a motion made by the mother for a restraining order on Patric's use of the name of his son for his charitable endeavors. There, a judge ruled that under the First Amendment, forbidding Patric from using his son's name for "Stand Up for Gus," an advocacy outfit that raises awareness of parental alienation, would be a prior restraint.

Email: Eriq.Gardner@THR.com

Twitter: @eriqgardner