A Brazilian judge has ruled that two identical twins must both pay maintenance for a nine-year-old girl after a DNA test failed to identify which was her father.

Each man will have to pay 30% of Brazil’s monthly minimum salary – around £59 – and share the mother’s medical, dental, clothing and school costs.

“One of the brothers, in bad faith, seeks to conceal paternity. Such behaviour should not be protected by the judiciary,” Judge Felipe Peruca wrote in his ruling.

The case has drawn national attention and shocked the small rural town of Cachoeira Alta, in Goiás state, where the twins live.

“Since adolescence, the pair used their identical appearance to hide betrayals and win over more women,” the Goiás justice tribunal said in a statement, explaining that the mother had a brief relationship with the father after both met at a party held by mutual friends.

“He told me he had a twin brother, but I wasn’t introduced. At the time I didn’t suspect anything,” the mother said, according to the court statement. Neither she nor the twins have been named.

She went to court to demand the man she had the relationship with take a DNA test.

When it turned out positive, he said his twin brother was the father – but his twin’s test also came out 99.9% positive, because identical twins come from the same fertilised egg and have the same DNA, the court said.

“It’s a very sad attitude, there was no need for this. They know the truth but took advantage of the similarity to escape responsibility,” the mother said. A more detailed “twin test” would cost about £12,000 ($15,773) and not necessarily be conclusive, the court said.

Evandro Paganini, a lawyer for the mother, now 25, said she had relations with the man just once. She has a nine-year-old daughter as a result and began court proceedings in 2017. The mother is unhappy with the result and plans to appeal. “We believe the child has the right to know who the biological father is,” Paganini said

Deborá Medeiros, a lawyer for one of the twins, said her client had not authorised her to comment.