A Manhattan Criminal Court Judge is trying to overturn his father’s will because it states he must marry the mother of his child – despite the fact she acted as a surrogate for him and his husband.

Robert Mandelbaum, 47, and his partner Jonathan O’Donnell, 39, were married in 2011 when their son, Cooper Mandell was 16 months old.

Mr Mandelbaum’s late father, Frank Mandelbaum, who died in 2007, left $180,000 in trust for his three grandchildren.

As reported in the New York Post however, the will included a stipulation that Cooper be excluded from his share if Mr Mandelbaum was “not married to the child’s mother within six months of the child’s birth.”

But the child’s mother is a surrogate, and her name has thus far been kept private. Robert Mandelbaum said the closest thing to a “mother” his son knows is Mr O’Donnell.

The New York Post stated that Robert Mandelbaum’s attorney Anne Bederka, wrote in court papers: “Requiring a gay man to marry a woman . . . to ensure his child’s bequest is tantamount to expecting him either to live in celibacy, or to engage in extramarital activity with another man, and is therefore contrary to public policy.”

Robert Mandelbaum is fighting the will on the basis that it is discriminatory and would force him to “enter into a sham marriage.”

The woman who was married to Frank Mandelbaum at the time if his death, Ann Freeman, said that the will was certainly worded so that Cooper Mandell would be left out of it.

She said: “[Robert] alleged that he had a son from a homosexual relationship which he believed should be a beneficiary . . . My husband’s will specifically prohibited such a child from becoming a beneficiary.”

Robert Mandelbaum says his sexuality and his relationship were no secret in his family and that he and his husband were often included in family gatherings and vacations.