In one of his famous cartoons, American Gary Larson has cows standing about on their hind feet, smoking fags by the side of a road. One of them, the lookout, shouts "Car!" and by the time the motorist reaches them he gazes out on an idyllic scene of cows munching grass on all fours. The cows are doing cow things, and all is well with the world.

It's a good joke, of course. Or maybe a dark reference to the not-so-distant past when Europeans - and some Americans - dressed animals up, put them on trial for heinous crimes and executed them, thereby judging them on a par with humans when it came to freely deciding their actions and being morally responsible for the outcomes.

Since those times, ideas about animals have swung to the opposite extreme, with animals being judged as lacking awareness of their own internal states and relationships to others, and hence incapable of true suffering, not to mention criminal behaviour. Those ideas, arguably, are what until recently gave people licence to carry out cruel animal experiments and to farm animals in conditions that, applied to humans, would be called torture.

But new research suggests that animals have far more complex cognitive and social skills than we gave them credit for. The focus in recent decades has been on wildlife but the uncomfortable truth now emerging is that something similar holds for animals we like to eat: pigs, sheep, cows, chickens. At a meeting in London on animal sentience today, leading scientists and animal welfare experts will claim that we are in the middle of yet another swing in the way we treat animals - away from dumb beasts, but not as far, hopefully, as pigs in culottes.

First for some findings. Last October, Ana da Costa and colleagues at the Babraham Institute in Cambridge reported that when sheep were isolated from their flock, they experienced stress as measured by increases in heart rate, stress hormones and bleating. But showing them pictures of familiar sheep faces reduced their stress on all three counts. The same effect was not produced when they were shown pictures of goat faces or inverted triangles.

Cows, too, can recognise a familiar face, says Donald Broom, professor of animal welfare at the University of Cambridge, and often form long-lasting, cooperative partnerships. They also show a physiological response on learning something new. He and colleague Kristin Hagen put heifers in a situation where they had to press a panel to open a gate and gain access to food. Those that learned the task were more likely to experience a leap in heart rate and to gallop than those that did not -"the eureka response".

Other research has shown that if offered a choice of two feeding stalls, pigs will avoid the one they remember being shut into, previously, for several hours after eating, and go for the one they were released from quickly. Lame broiler hens, or hens bred for meat, will choose food laced with painkillers over food that is not. And rainbow trout will learn to react to cues that predict noxious stimuli, moving away from them to a different part of the tank.

None of these findings proves that animals feel pain, or joy for that matter, in the same way that humans do - and there is no way of testing their subjective experience. But according to Broom, the evidence that they are capable of learning associations suggests brains that are, at the very least, aware of what has happened in the past and of acting on it in future.

That awareness tends to engender respect in humans, he says. It is the foundation of collaboration and mutual aid - for instance, knowing not to attack a familiar face. In animal communities, even unrelated individuals take care not to harm each other. Animals with sharp horns or big teeth, or weighing several tonnes, will move carefully so as not to damage others - an observation that, in the past, has been put down to their desire to avoid retaliation. But, says Broom, "there are so many cases where injury would be easy and retaliation would be unlikely, it's clear enough that a lot of this is done with a more general aim of keeping the group stable".

He points to plentiful examples of animals collaborating rather than competing. Cows and horses form "grooming partnerships", just as chimps do. Altruism is compatible with the survival of the fittest, if helping others increases the likelihood that one's own genes will be passed on - if those you help share some of your genes. Humans violate that rule by occasionally helping out unrelated individuals. Broom now thinks it isn't only humans that behave in this mysterious fashion, and that animal societies have been misunderstood. "In any social species with a reasonably advanced brain, it is necessary to have something equivalent to morality in order that the society will function," he says.

American animal rights lawyer Steven Wise has taken that idea a step further. He argues that the foundation for according basic civil liberties to people is that they possess "practical autonomy" - that is, a sense of self, plus the ability to desire something and to have the intention of fulfilling that desire. Roaming through the literature on animal cognition, he found that this applied to quite a lot of animals - namely the great apes, elephants, dolphins, African grey parrots, dogs and honey bees. Now he says it applies to some farm animals too. In his latest book, he compares the current legal status of these animals to that of the black slave James Somerset, who in 1772 convinced a British court that he was a person with rights, not a piece of property. Among the basic rights these animals deserve, Wise says, is the right to freedom from battery, which would rule out all killing for food, and most lab testing.

This is not a new argument, and a debate took place along these lines in New Zealand in 1999. Scientists and lawyers tried to persuade the country's parliament to recognise the closeness of chimps and other primates to humans, and to give them rights. They failed, but the animals were granted instead legal protection from animal experimentation. Britain had already taken that step, and Home Office guidelines now forbid experiments on chimps, orang-utans and gorillas.

Before it was thrown out, the New Zealand bill for conferring rights on nonhuman primates came in for some harsh criticism, as has Wise. The critics argue that while animals must be protected from abuse, rights are part of a social contract that makes no sense without responsibilities.

The claim that animals have morality "has an ugly history" in animal trials, says Andrew Linzey, a theologian and expert in the ethics of animal welfare at Oxford University. And Frans de Waal, a primatologist at Emory University, Atlanta, points out that social animals rarely, if ever, direct altruism to other species.

"The animal rights movement's outrageous parallel with the abolition of slavery - apart from being insulting - is morally flawed," de Waal wrote in the New York Times in 1999. "Slaves can and should become full members of society, animals cannot and will not." Six years on, he says, he has nothing to add to that.

Since 1997, European law has recognised that animals are sentient. That is, that they can be aware of their surroundings, of their own bodily sensations including pain, cold, hunger, and of their relationships with other animals, including humans. A sentient animal is not necessarily intelligent, or capable of learning or understanding, but it can suffer in ways that are not purely physical - for example, by being prevented from following its natural instincts. So that change in the law marked a significant shift from earlier attitudes towards animals, which defined cruelty in strictly physical terms. And it is unique. Sentience is not enshrined in US law - yet. "We are living through an ethical revolution when it comes to animals," says Linzey. "We are shifting from seeing them as objects, commodities, resources, to seeing them as beings in their own right."

He says that the status of children and animals have been linked throughout history, both having been regarded at one time as the property of their parents and owners respectively. Societies that have a bad record on human rights tend also to have a bad record on animal welfare. It is significant, he says, that several Chinese delegates will be attending the meeting in London, which is organised by Compassion in World Farming, a group that campaigns for the abolition of factory farming.

Peter Li, a political scientist at the University of Houston-Downtown, Texas, says that no comprehensive animal cruelty legislation exists in China and animal welfare has only been debated there at all in the last four years. One of the triggers for the discussion was the tracing of the severe acute respiratory syndrome (Sars) epidemic to poor animal husbandry and, in particular, overcrowded cages.

It may be early days for China, but elsewhere research on animal sentience is beginning to inform approaches to animal welfare and husbandry. One of the big problems with farmed fish, for instance, is their vulnerability to predators, because having been raised in hatcheries, they never learn to fear them. It turns out that fish release chemical alarm cues when they sense danger, and that in a natural population, fish that have survived encounters with predators give off these cues, triggering a fear response in others and teaching them to avoid those predators.

According to Kevin Laland, who studies social learning in fish at the University of St Andrews, this kind of teaching is an example of fish culture. Among fish, different social groups maintain different traditions which are passed from generation to generation. A tradition may be the path they take through a coral reef, or the tendency to return to a certain mating site, or as in this case, the knowledge that a predator is dangerous. He says one potential solution to the predation of farmed fish would be to introduce into hatcheries fish with experience of predators. "They might release some chemical alarm cues which the naive fish could pick up on," he says. That way, the naive fish would learn to be scared.

Among whales and dolphins, too, hunting techniques are passed on from individual to individual. "One of the reasons why the big whales may not have recolonised areas from which they have been exterminated by the whaling industry may be that the cultural knowledge of how to hunt that habitat was actually lost with the animals that were killed," says Mark Simmonds, director of science at the Whale and Dolphin Conservation Society. Having served on the scientific committee of the International Whaling Commission for almost a decade, he is used to conservation being discussed in terms of numbers that can sustainably be removed from the ocean. Now, he says, it is clear that population boundaries must be taken into account too, so that pockets of local knowledge can be preserved.

Farming is also becoming more animal-centred, says Roland Bonney, director of the Food Animal Initiative (FAI) in Oxford. He and his colleagues are developing housing for pigs that provides them with a woodchip floor to root in - thereby satisfying their natural instinct to dig. But there is still a long way to go. For instance, free range hens are seen as the animal-friendly alternative to battery hens, but it turns out they have problems of their own: a tendency to peck at each others' feathers and in extreme cases, to cannibalise.

In 1985, Kim Cheng of the University of British Columbia noticed that congenitally blind hens did not do this, and that blind hens might even be less susceptible to stress than sighted ones. He suggested breeding blind, free range hens as a solution. But Bonney says this would not be acceptable to him or, he believes, to the public at large. Instead, the FAI is conducting research into why pecking occurs at all.

"There do not seem to be scientific reasons to think that [blind hens] have a welfare problem," says Peter Sandøe, a bioethicist at the Royal Veterinary and Agricultural University in Copenhagen, Denmark. "Still most people would think that it is wrong. In general, science gives important but often rather narrow insights into animal welfare."

In 2000, for instance, a European Commission report recommended that 30kg per square metre was the maximum density at which broiler hens should be kept. But, says Sandøe, "There is clear evidence suggesting a linear relationship between density and stress [in broiler hens], so there is no obvious cut-off point."

Without a reliable way of gauging animals' subjective experiences, he says, animal welfare has to be based largely on common sense. Some farm animal welfare councils are taking this on board, but the European Commission animal welfare committees are still populated solely by scientists. Unless scientists admit that many of their decisions are arbitrary, Sandøe believes they will discredit the real science, allowing sceptics in countries with little or no animal protection to laugh off their efforts, along with pig murder trials and Gary Larson cartoons.

Animal trials

New gloves for the hangman and a dress for the pig

In his book, The Criminal Prosecution and Capital Punishment of Animals, 19th century American scholar Edward Payson Evans chronicles animal trials that took place, mainly in Europe, between the ninth and 19th centuries.

Evans' account was taken from the earlier published records of one Bartholomé Chassenée, a 16th century French jurist who made his reputation as counsel for an unspecified number of rats. The rats were prosecuted in the ecclesiastical court of Autun for having feloniously eaten and wantonly destroyed local barley.

One of the most notorious cases Evans describes was the public execution in 1386 of an infanticidal sow in the French town of Falaise. Having been convicted by a court of law, the sow was dressed in human clothes and executed in the main square by an official hangman who had been given a new pair of gloves to mark the solemnity of the occasion.

Sometimes the condemned were offered clemency. According to Evans, youth could be grounds for acquittal, as in the prosecution of a sow and her six piglets for having murdered and partly devoured a child. The was sentenced to death, but the piglets were acquitted on account of their immaturity and the bad example set them by their mother.

In all, Evans records around 200 animal trials in this period, the last one being the trial of a dog in Délémont, Switzerland, in 1906.

Further reading

The Evolution of Morality and Religion Cambridge University Press, ISBN 0521529247

Donald Broom on the precursors of our moral code

The Criminal Prosecution and Capital Punishment of Animals Faber & Faber, ISBN 057114893X.

EP Evans's account of animal trials from the ninth to 19th centuries

Though the Heavens May Fall Da Capo Press, ISBN 0738206954.

Steven Wise on the trial of a black slave, James Somerset

Compassion in World Farming 2003 report on sentience in farm animals

www.animalsentience.com/images/Sentience_report_2003.pdf