Men who donate sperm can apply to seek a role in the lives of their biological children, the High Court has ruled in a dispute involving two lesbian couples who were friends with two gay men.

On Thursday, Mr Justice Baker ruled that two men, whose sperm was used by the lesbian couples, could apply through the courts for contact.

Justice Baker said that lesbian couples and their children had exactly the same legal status as any other parent and child, however “it is still open to the court, after considering all relevant factors, to grant leave to other persons to apply for (contact) orders”.

The judgement does not mean that any future application would be successful.

Kevin Skinner, who is from the firm Goodman Ray and represented one of the lesbian couples in the case, said: “Although the judge’s decision makes clear that the family unit should be protected, the possibility of donors being able to apply for courts orders will be a scary prospect for many parents, both gay and straight.

“What is crucial is that anyone planning on having a child through the use of fertility treatment should make sure that proper plans are in place before the process begins.”

Jonathan West, head of family law at City law firm Prolegal said: “Being a sperm donor is not something to be taken lightly, but many people in the UK are entering into ‘private arrangements’ without thinking hard about what each party’s rights are. Where there is uncertainty, the courts have begun to favour bringing donors into their children’s lives, where the donor wants contact. The only way to ensure everybody gets what they want is to have an arrangement agreed by all parties which will stand up in a court of law.

“Of course, these situations are often very personal and aren’t something people want to write up, but not making clear where donors and parents stand can lead to a lot of heartache down the line.”

Mr West added: “The latest ruling may worry some parents who would prefer sperm donors not to play a role in their children’s lives. But unless clear agreements are in place, donors can find themselves in an uncomfortable position too.”