"Working with pit ponies was one of the most enjoyable experiences I had as a miner," recalls Northumberland-born Bill Riley, a miner for 35 years until he was made redundant in 1993. He worked with ponies until the 1960s. At the start of each shift, Riley would harness his pony: "I'd speak to him and give him a pat or a stroke. Most miners were very fond of the ponies, and many took bread for them to eat."

Horses began working underground in the 1700s and continued to do so throughout the industrial revolution. The use of pit ponies went into steady decline after 1913, when the number registered reached a peak of 70,000. When the National Coal Board was set up in 1947, there were 21,000; by 1984, their numbers had fallen to 55. The last two working pit ponies in Britain retired from the Pant y Gaseg mine, near Pontypool, as recently as 1999 - although these did not spend their whole lives underground. The practice of stabling ponies deep in the mines finally came to an end in 1994, when a pony called Flax was brought to the surface at Ellington Colliery in Northumberland for the last time.

Mindful that a slice of industrial history was about to be erased from living memory, writer and lecturer John Bright began collecting miners' stories, culminating in a book, Pit Ponies, published by Batsford in 1986. He found that "many, many miners and ex-miners felt the horses that worked underground needed their stories telling".

One of the reasons for the strong bond between man and horse was the belief that the ponies had a "sixth sense" and could alert men to danger and even save lives. Bright's book is full of anecdotes of equine foresight and courage: "Bounder would always guide me to safety"; "When I got up to Fido, he rubbed his nose on me and snorted. Seconds later, there was a terrific crash"; "If it hadn't been for that pony, we would have died."

But it's a mistake to romanticise what was essentially a working relationship; the miners did not always have the luxury of kindness. "The relationship between driver and pony is a complex one," Bright writes. "The man was compelled by the system to force the animal to work extremely hard, yet aware that the pony and he suffered similar privations."

The shared torment of miner and horse runs through Emile Zola's novel Germinal, a nightmare vision of the relentlessly bleak existence of impoverished miners. In the miserable underworld of the colliery, workers are reduced to beasts of burden and a pony, Trompette, is similarly "lost in the nightmare of this black and endless cavern", and "tortured by longing for the daylight he has lost".

Ponies stabled underground were brought to the surface only when the pits closed for two weeks every summer, and the shock of the open air often sent them into a galloping, whinnying frenzy. Strikes also gave them a welcome break on the surface, and even if they remained below ground, no union official would stop the horsekeeper from crossing the picket line to feed his charges. Zola's Old Mouque, for instance, thrusts his way through strikers and soldiers to the pit entrance, saying his horses "went on eating oats just the same and didn't care two hoots about a revolution". The tragic fate of the ponies is ultimately echoed in human loss, but unionisation and nationalisation eventually improved conditions for man and horse alike.

"Thankfully," says Bill Riley, "ponies were eventually removed from the pits." While miners were happy to see them put out to pasture, there's still a hint of sadness for a lost way of life. One miner quoted in Pit Ponies sums it up: "Of all the cruelties committed against the animal world, surely sending ponies underground to haul must be the worst. But I must selfishly admit that those marvellous little creatures gave me the happiest moments of the years I worked in the pit."