Distinguishing between a hungry Scottish wildcat and a ray of sunshine is rarely difficult. Hamish, top feline at the Highland wildlife park in the Cairngorms, provides a perfect example. It is lunchtime and he is in a stroppy mood. His keeper is late with his dish of raw meat. Hence Hamish's display: a tail bristling like a Christmas tree, a set of snarling fangs and a barrage of hissing and yowling for the humans standing outside his enclosure. This is an animal with a grievance – and a temper.

Hamish is massive, as big as a medium-sized dog, and weighs almost 8kg, double the weight of an average household tomcat. This is a real muscled bruiser. "I have come out of that enclosure with blood dripping from my hands on many occasions," says Robbie Rankin, a keeper at the wildlife park.

A solitary hunter that kills rabbits, not to mention the occasional hare or young roe deer, the Scottish wildcat is ferocious, elusive – and endangered. Once widespread across the British Isles, the wildcat has disappeared from all but a few ecological niches in the Highlands. And numbers continue to tumble, an issue that will be addressed in two Scottish Natural Heritage reports, on wildcat distribution and wildcat genetics, that are to be published this month.

For several years, conservationists have warned that loss of habitat, road accidents and – worst of all – the spread of domestic cat populations are having a devastating impact on the Scottish wildcat. Populations of a species which has earned itself a reputation for its aloof ferocity and independence are plunging to catastrophic levels. There are now fewer pure-bred Scottish wildcats than there are tigers in the wild. It is estimated only 400 or so survive in the wild, mostly in the Cairngorms area.

"Until recently, we thought there were about 3,500 wildcats in Scotland," says Dr David Hetherington, manager of the Cairngorms Wildcat Project which was set up to help save the species.

"But then a detailed study was done on animals that had been killed in accidents. It was found that only about 12% of them were actually pure wildcats. The rest were either feral cats or hybrids of wildcats and feral cats. As a result, we had to drop our estimate of wildcat numbers from several thousand to only a few hundred. That was the wake-up call to the seriousness of the situation."

Today, saving the Highland wildcat has become a key concern for Scottish conservationists and understanding its relationship to its domestic cousin, the household cat, will play a pivotal role in that work, say scientists.

The origin of the world's cats has been a source of dispute among animal experts for decades. Most domesticated animals, such as dogs, lived in packs or herds in the wild and had clear dominance hierarchies that were exploited by the first farmers who took over the role of their leaders. By contrast, cats are solitary hunters that defend their territories fiercely against transgressors. So how were they transformed into domestic moggies? And for that matter, where did this change take place? In the past, some scientists argued that cat domestication occurred in a number of different locations, with each domestication spawning a different breed. By this reckoning, British tabbies were descendants of British wildcats. Others claimed that domestic cats were ancient Egyptian in origin, and pointed, as evidence, to the fact they were worshipped as gods in the days of the pharaohs.

Then, in 2000, the issue was resolved – in an unexpected manner – by researchers led by Carlos Driscoll of Oxford's Wildlife Conservation Research Unit. His team took samples from 979 wildcats and domestic cats from across the world and found the wildcats grouped into three main genetic clusters: the European wildcat, Felis silvestris silvestris; the Middle Eastern wildcat, Felis silvestris lybica, and the southern African wildcat, Felis silvestris cafra.

The team looked at domestic cats in the UK, the US, Japan and elsewhere and found that they were all made up of members of Felis silvestris lybica. The inference was clear. "That the domestic cats grouped with Felis silvestris lybica alone among wildcats meant that domestic cats arose in a single locale, the Middle East, and not in other places where wildcats are common," states Driscoll and colleagues in a paper in Scientific American.

Combined with other evidence, the research paints a clear picture of the domestic cat's origins. As neolithic men and women created the first, primitive townships and settlements 10,000 years ago in the Fertile Crescent in the Middle East, mice, rats and other vermin moved in to raid their grain stores and their rubbish heaps. Middle Eastern wildcats followed after these pests and before long they had adapted to life among men and women. The cats did little harm to humans and would have been encouraged to stay because they were such effective pest-controllers, says Dr Andrew Kitchener, principal curator of birds and mammals at the National Museums of Scotland. "The scientific evidence indicates that the ancestry of domestic cats goes back to Mesopotamia where genetically similar wildcats now live."

Then as agriculture spread from the Middle East, the cats came with the farmers. They spread into Europe and then into Britain. And still the cats followed. Thus the household moggie, a feline immigrant from the Middle East arrived in the homes of Britain, while the nation's own wildcats – made up of members of the larger, stronger striped species of European wildcat, Felis silvestris silvestris, were pushed to the margins of the nation as settlements spread and its wild places were stripped away.

"Wildcats disappeared in lowland England around 1800," says Hetherington. "Then they vanished from Wales and northern England around 1860. Finally, they went from southern Scotland. All we have left is a few hundred around the Cairngorms and places like the Black Isle. The trick now is to find a way to stop them from disappearing completely."

The Cairngorms Wildcat Project was set up last year with the specific remit of halting the animal's decline. It has a simple logo – "Highland Tiger, the Scottish wildcat" – to hammer home the fact that the animal has become as endangered as the tiger and that it is, pound for pound, as ferocious as any other feline on the planet. It also happens to be the only one native to the British Isles.

"Our first aim is simply to raise awareness," adds Hetherington. "We have this special animal living in the Highlands that we should be tremendously proud of. The more people that start to care for it, the easier it will be for us to save it."

Routine risks facing wildcats include crossing major roads and avoiding being shot, by mistake, by gamekeepers. (It is against the law to kill a wildcat but not a feral cat in Scotland.) But most of all it is the danger posed by interbreeding with domestic cats that worries conservationists like Hetherington.

"The problem is not one caused directly by domestic cats," he adds. "The trouble arises when household animals go wild, mate and create colonies of feral cats. These form at the edges of villages and in farms. Some of these feral animals meet up with wildcats and they mate. Female wildcats become pregnant and give birth to kittens that are not purebred wildcats. Slowly, the species loses its unique status and vigour and animals become hybridised. That is the real problem today."

The short-term answer, he says, is to promote vigorously the principles of good cat ownership: neuter all pets and make sure they are properly vaccinated for all major feline diseases. "We are trying to turn off the taps in terms of the supply of feral cats in the countryside," adds Hetherington. "They pose a risk not just of interbreeding but of bringing diseases from domestic populations into the wild so they affect wildcats. We need to involve gamekeepers, vets, cat protection officers and a range of other conservationists. The trouble is that it will take us a long time to find out if we are succeeding. These are very elusive animals, after all. Studying them is very difficult."

And that is a problem for many wildcat experts. Merely waiting around collecting data without forming a plan of action is not enough, says Kitchener. "Just look at the Chinese river dolphin. A lot of people were supposedly working towards its conservation, but no one actually did anything practical. Then one day they realised that it had just disappeared."

The answer for the Highland wildcat, he argues, is not just to tackle the dangers it faces from feral animals, but to launch a full captive breeding programme as a matter of urgency. "That may involve taking some animals from the wild to make sure we can build up the best genetic stock but we will have just to face up to that. In five or 10 years' time, if you find the game is up for the animal in the wild, you will then be able to think practically about reintroductions in particular areas. But if you just keeping saying we are not sure and don't do anything, we could end up with no wildcats left at all."

Not every wildcat expert agrees. Some point out that there is little point in reintroducing animals to the wild if the causes of their eradication there have not been dealt with. The new animals will just get killed like their predecessors or hybridised with domestic cats.

Yet Kitchener insists it is imperative that work begins on building up a reintroduction stock before populations crash any further.

"Look at the Iberian lynx. A few years ago, its numbers were down to around 100. So conservationists collected a third kitten from every litter on the basis that a third kitten is normally killed by wild parents. Then they reared the kittens and are now ready to start reintroducing them into the wild. We should be planning that now. The alternative is a future with no wildcats left in the British Isles."