Two Dutch gay men have been ordered to give back their two-week-old baby to her surrogate mother after a DNA test showed that the woman’s husband was the biological father.

Arnout Janssen and Stefano Franke had found the woman online in 2016 and after a series of meetings hired her to carry their child.

She underwent artificial insemination last September and was thought to be pregnant by one of the two men

The surrogate mother had agreed to have only protected sex with her husband to ensure that Janssen or Frank would be the father should she become pregnant.

However, a DNA test proved that the biological father was in fact the unnamed woman’s husband.

“For us it was a huge shock. Hayley was and is our child,” Janssen said.

“It still feels like that. She has been with us for two weeks.

“And suddenly, just on a beautiful spring day, she is gone and changes the nursery into a place of sorrow. As if somebody died.”

A hearing to finalise the adoption took place last Friday, when the woman said she and her husband wanted to keep the baby.

After one more night with the gay couple, Hayley was picked up by social workers last Saturday.

Franke said: “All our friends and family have been visiting. At night, we had her in bed for the last time. I’ve been watching her for hours. It’s incredibly hard to get her out.”

Related: Can same-sex parents both be biological parents of their child?

Arnout Janssen and Stefano Franke have been a couple for four years and married two years ago. Their dream of having a child was one of the things that brought them together.

When the baby was born they spent two nights at the hospital after the biological mother had already gone home to her three children.

“As gay parents, you actually have no rights,” Janssen told AD.

“Everything depends on the mother’s willingness and good faith. Apart from an internet checklist, we had nothing on paper.”

The couple said that the mother had doubts about the adoption in the last weeks of pregnancy, but seemed to be happy with the arrangement just before the birth.

“She once again stated clearly that she wanted to leave the child,” Janssen said.

“She gave it to us. We have also been in childbirth. That was an incredibly emotional moment.”

On their blog about their surrogacy journey the two men wrote: “We do hope Hayley gets all the attention and love she deserves, and we hope she grows up to be an amazing woman.

“We love her very much and we will never forget her. To us she is our first child and we are blessed to have had her with us for 13 days.”

Gay parents are still struggling when it comes to asserting their legal rights after having a child via a surrogate.

In 2015, a judge in Texas refused to allow two gay fathers to be listed on their twin sons’ birth certificates – despite being their biological fathers.

This week, two gay dads said they and their children were denied priority boarding to a flight because the airline didn’t consider them a family.