It seems Jason Patric‘s long fight to gain parental rights of his 4-year-old son, Gus, may finally have a happy ending.

On Thursday, a judge declared Jason, 48, is the child’s legal father, which means the ‘My Sister’s Keeper’ star can now move forward with asking the court for custody and visitation rights of his son, a new report states.

Related Story: Stevie Wonder Expecting Triplets With Girlfriend Tomeeka Robyn Bracy

Jason won the appeal after a two-year-long battle with his ex-girlfriend Danielle Schreiber to be recognized as the boy’s father. Danielle previously claimed the actor had no legal rights to the child because he was conceived through artificial insemination in 2009 and barred Jason from having any contact with Gus.

jason patric court

Jason held a press conference outside of the LA court in September. (Photo Credit: Getty)

Under California law, mothers are granted full custody in the absence of a written agreement establishing parental rights before conception.

In February 2013, a judge originally sided with Danielle, but the ruling was later reversed after it was revealed the ‘Lost Boy’ actor did have parental rights as a sperm donor.

Related Story: Exclusive: Lucie Arnaz Tells Closer, ‘I See the World Through My Dad’s Eyes’

Prior to the court’s decision, Danielle told ABC News that Jason offered to donate his sperm after the two broke up “under the express condition” that it be kept secret and “that he would not be a father to or have any obligations, rights or responsibilities for my child.”

After dating on and off for nearly 10 years, Jason and Danielle officially split in June 2012 when Gus was 19-months-old.

TMZ was the first to report this news.