Lost Boys star Jason Patric has lost a bid to win legal visitation rights to see his son with former girlfriend Danielle Schreiber.
His case is complicated by rights governing sperm donation.
The child was allegedly conceived after the couple had broken up, when he offered to act as a 'sperm donor' on the condition that Schreiber did not seek child support or tell anyone about the arrangement.
According to TMZ, Patric, 46, made the arrangement in 2009 as he did not have any money to give her at the end of their ten year relationship.
A source told the website that he made it clear he would only provide his sperm if she accepted the conditions, and their son Gus was born in December 2009.
Then in 2011 the couple attempted a reconciliation, and by the time they broke up in May 2012 Patric had grown attached to Gus.
This led to him filing documents at a family court asking a judge to award him 50/50 custody.
But there is a law which states if an unmarried man artificially inseminates an unmarried woman with the help of a physician, he is not legally the father and has no custody rights.
The judge ruled in the case on Wednesday
according to TMZ and said that the a law states if a man donates sperm to a woman to whom he is NOT married and she's inseminated with the help of a doctor, the man has no paternity rights or claim of custody.
But all is not lost for Jason as his former lover is apparently happy to offer Jason the right to spend time with the boy voluntarily, although she objects to a judge ordering visitation.
Family man: Jason with son Gus and his on-off girlfriend Danielle Schreiber in December 2011
Her case centred on her belief that the Speed 2 star should not have any legal rights to custody or visitation.
A spokesman for Patric told MailOnline as the trial began: 'We are confident that the court will agree that both parties intended to, and did agree to have this child together; that Ms. Schreiber has publicly acknowledged Mr Patric as the father and that his custodial rights will be upheld.
'The court has already denied Ms Schreiber’s request to dismiss the lawsuit on the allegation that Mr Patric is merely a “sperm donor.”
Follow us: @MailOnline on Twitter | DailyMail on Facebook