A married French woman has been told she cannot adopt the child she and her partner had by IVF treatment carried out abroad.

In a surprise ruling, a court in Versailles said the same-sex couple defrauded the French law which bars homosexuals from medically assisted procreation by undergoing the procedure in neighbouring Belgium.

Equal rights organisations have criticised the decision, saying it goes against rulings in previous cases and is discriminatory.

The pair, who have not been named, have a four-year-old son, Martin, born to one of the women after IVF treatment. In November, the biological mother's partner applied to the family court for the right to adopt the boy so he would have two legal parents.

The court refused the request, declaring the IVF was "in violation of French law … and constitutes a defrauding of the law". It said it was "banning the adoption of an illegally conceived child".

Same-sex marriage and adoption were legalised by France's Socialist government a year ago. However, IVF is only given to heterosexual couples. Surrogacy is illegal for all in France.

A proposed family law that would have opened a debate on IVF for homosexual couples was dropped by President François Hollande earlier this year after vehement opposition from "pro-family" campaigners, many of them from the traditional Catholic right.

The organisation Enfants D'arc-en-ciel (Rainbow Children), a gay and lesbian parents' association, said in a statement: "There will be other cases. The opening of marriage and adoption [to same-sex couples] was supposed to protect our families."

Another rights group, Inter-LGBT, went further, saying "the children of homosexual parents are the new bastards of the Republic", while the Association of Homoparental Families (ADFH) said: "The homophobic Versailles court has not acted in the interest of the child".

However, Ludovine de la Rochère, president of the group La Manif Pour Tous, which is opposed to gay marriage and adoption, said the court had ruled correctly.

"I can understand that these two women are upset about the judgement, but to approve their request would be to encourage an illegal practice. Adoption is an institution to serve the child, it is a response to the death of a child's parents or if it has been abandoned. It is not a means for adults to use for their own ends."

The couple's lawyer, Caroline Mecary, told journalists she would appeal against the ruling, saying that, despite fierce opposition, around 20 same-sex couples have been allowed to adopt in similar situations.