In the case of a divorce, who keeps the family cat or dog? Spain has ruled that, as with children, parents should in some cases share custody.
A new law that came into effect on Wednesday recognises pets as "living, sentient beings" for the first time, and not mere objects.
As a result, family courts must consider both the animal's welfare, as well as the family needs, when deciding who looks after the dog, cat, goldfish, turtle or bird.
Spain is the latest European country to recognise animals as sentient beings, joining a group that includes France, Germany, Switzerland, Austria and Portugal.
The legislation, which was drafted by the ruling Socialists and their leftist coalition partners Podemos, aims to end the legal wrangling that often erupts among estranged couples over who keeps the pets.
It stipulates that owners must "guarantee" the pet's well-being and that if either spouse has a history of cruelty to animals he or she may be refused or lose custody of the animal.
The law, which amends Spain's civil code, also requires courts to consider the animal's welfare when settling disputes over who inherits a pet.