I was walking on a quiet country road near my home the other day when I spotted a small body in the centre of the tarmac. Initially, I thought it was a domestic cat that had met its fate on one of its nightly forays. On closer examination, it was nothing like a cat.

The overall fur colour was a deep chocolate brown with a distinctive cream-coloured bib beneath its chin. The ears had pale creamy margins and the tail was bushy, much like that of a fox. I knew immediately that this was a wild mammal called the pine marten.

In Irish, the species is known as cat crainn, the tree cat, which reveals its preference for woodland habitats. Indeed, there was woodland on both sides of the road where I found this sad traffic casualty.

The earliest evidence of pine martens in Ireland comes from the late Bronze Age, a period when woodland cover was considered to have been high but beginning to decline. In 1850, William Thompson, one of Ireland’s early naturalists, reported that the species was still present in every county in Ireland.

After that, woodland in Ireland shrank to cover only one per cent of the country at the beginning of the 20th century. Around that time, poisoning and persecution, together with the loss of its woodland habitats, led to the near extinction of the pine marten in Ireland.

Some extensive research on pine martens in Ireland was done in the 1970s and 1980s by Paddy O’Sullivan, originally a forester who joined the Forest and Wildlife Service as a trapper. When the pine marten was protected under the original Wildlife Act of 1976, O’Sullivan was handed the task of discovering facts about this mammal, which was thought to be still declining and largely confined to a few refuges in counties Waterford and Clare.

By examining more than 800 of their distinctive droppings (known as scats), O’Sullivan concluded that the pine marten in Co Clare had an extremely catholic diet that included small mammals, birds, frogs, lizards, a variety of insects and especially earthworms. In the autumn, it often turned to fruit such as blackberry, wild cherry, crab apple and ivy berries as well as hazel nuts.

How the Dingle Peninsula is modelling a new way for rural Ireland to thriveOpens in new window ]

In recent years, extensive research has shown that the pine marten may be a keystone species in the woodland ecosystem. As expert tree climbers, they are well able to hunt squirrels either in the treetops or on the ground.

The decline and near extinction of the pine marten in Ireland coincided with the introduction and spread of the introduced American grey squirrel, which led to decline of the native red squirrel.

However, the recent marked expansion of the pine marten has mirrored a corresponding decline or even complete disappearance of the grey squirrel in some parts of the country. It seems that the grey squirrel is especially vulnerable to this predator because it did not evolve with it as the red squirrel did, and because the greys spend more time feeding on the ground where the marten is most active.

There has been a decline or even complete disappearance of the grey squirrel in some parts of Ireland. Photograph: Ross Kinnaird/Getty ImagesThere has been a decline or even complete disappearance of the grey squirrel in some parts of Ireland. Photograph: Ross Kinnaird/Getty Images

It is also known that red squirrels will leave an area if they detect the scent of a pine marten. It has been found the red squirrels have returned in areas where the pine marten is now present.

Today forests cover 11 per cent of the land, although the majority of these consist of commercial conifer plantations. The spread of forestry in the 20th century and the banning of the poison strychnine in the 1980s are all thought to have helped in the recovery of the pine marten.

Recent island-wide surveys have shown that the species is continuing to recover and is found across parts of Ireland where it had been absent for more than a century. With a remote camera, I have recorded some daylight video footage of this exciting animal in the woodland on our own farm in Co Wicklow.

By 2005-2007 the population range extended to more than half of Ireland, with a total population estimate of at least 3,000 individuals. The pine marten is still one of the rarest wildlife species in Ireland but the potential for a full recovery is clearly there.

After a detailed examination, I moved the perfect small body of this wild animal to the side of the road and laid it under an oak tree in the habitat it preferred in life.

Richard Nairn is an ecologist and writer. His latest book is Future Wild: Nature Restoration in Ireland.