A lesbian and a gay man are fighting a custody battle over their two children who were conceived by artificial insemination.

The lesbian mother, who is in a civil partnership, had two children, now aged seven and nine, with the man after he advertised in a gay magazine to become a father.

A previous ruling granted the father a joint residency order but the mother, who cannot be named, is challenging it at the Court of Appeal.

The case is a legal first and will be heard by the highest civil judge in the country – Master of the Rolls Lord Neuberger and two senior colleagues.

The Daily Mail reports that the father’s original advertisement said he was a solvent man who had “everything but kids”. It added that he wished for “a little involvement” as a father.

The mother and her civil partner, who have been together for more than 20 years, answered his advertisement. They had a boy and a girl after artificially inseminating his sperm.

They had been the children’s primary carers since birth. This year, a Brighton judge awarded the father a shared residency order and directed that the children should spend almost half of the year with him.

But the mother is arguing that he is trying to “marginalise” her civil partner and “overpower” the children with his forceful personality.

The lesbian couple’s lawyer, June Venters QC, said that the children do have a meaningful relationship with their father but that the couple should be granted day-to-day custody of them.

Ms Venters said that the currently arrangements were “enormously complex” and did not make clear the contribution of the mother’s partner to the children’s lives.

The appeal court hearing continues.