Award-winning wildlife photographer Dave Slater was battling 45-degree heat in a national park in northernmost ­Indonesia, just 50 miles from the Equator.

He was carrying a 40lb backpack, tripod, camera, several expensive lenses and a pack of rather soggy Jaffa Cakes for sustenance.

It was his final week of a month-long trip that he'd planned and funded himself almost seven years ago, and he'd lost nearly 2st lugging his kit through the rainforest.

'It was really gruelling — like something from the SAS!' he says today at his home in Chepstow, Wales.

His aim was to photograph animals which were endangered, and use the images to draw attention to their plight.

The Holy Grail was the very rare crested black macaque — a critically endangered monkey with an entirely black face that is found on just two Indonesian islands.

'There were only a few hundred left and I'd only ever seen a photo of one,' says Dave.

The famous 'monkey selfie' that has cost wildlife photographer Dave Slater dearly

'I was enthralled by the look, their hairdo, the charismatic face. Seeing one was to be the crowning glory of my trip.'

When this was achieved — with the help of a local guide — Dave was overwhelmed.

'It was just amazing — surreal.' A troop of around 20 were playing together. From some 150 yards away, using a long lens, Dave began observing, shadowing andphotographing them — winning their confidence and edging closer.

By the next day, the inquisitive animals were all over him; picking through his hair, rummaging in his backpack for food. 'They nicked my Jaffa Cakes!' They became particularly fixated by his camera.

It seemed they were excited by the whirring shutter sound and kept trying to press the button to hear it.

David Slater hoped the rare photos would earn him a fortune. But he says he has not made one penny from the famous selfie because of copyright battles over who owned copyright

When Dave tried a selfportrait with them — 'the word 'selfie' wasn't known back then' — they lunged for the remote button. In the end, in the spirit of fun, he decided to let them have a go themselves.

Eagerly, they pressed the button, grinning at their reflections in the lens. Among the hundreds of images they took (many not in focus!) was a brilliantly silly self-portrait of a grinning monkey.

Eyes gleaming amber, teeth goofy and mouth wide as if in laughter. After returning to Britain, Dave made a few thousand pounds from distributing the photos — covering the cost of his trip to Indonesia. But over time, with the rise of the selfie, his monkey snap became a classic — published more than 50million times around the world.

But instead of bringing Dave financial security and a warm glow of professional pride, it has caused him untold misery, cost him his life savings and marked the end of his photography career.

His story has all the elements of a 21st-century farce — involving crazy controversy over copyright law in a Californian court, and the 'inhumanity' of an activist animal charity that has filed a suit against Dave on behalf of the six- year- old male macaque, claiming it is the rightful owner of the photograph's copyright.

So it is that for the past six years he has been embroiled in what must be one of the most pointless, idiotic, money-wasting andaggressive legal battles of all time. So, who owns the copyright? Dave or the monkey?

Dave has never been in any doubt. 'Of course it was my copyright!' he says. 'I set the background. I decided where the sun was going to hit the monkey.

'I selected the lens and I processed the images. The creativity was all mine, and it required a lot of perseverance, sweat and anguish.'

His problems began when Californian-based blog Techdirt and the online encyclopedia Wikipedia (whose mission statement is 'to empower and engage people around the world to collect and develop educational content under a free licence or in the public domain') muscled in.

They claimed the image was uncopyrightable because the monkey was the creator — and so they uploaded the picture onto their websites, free for anyone to use. To Dave, this was an assault on his livelihood.

Understandably, he asked Techdirt and Wikipedia to stop using the pictures — but they refused. Faced with little choice, Dave decided to sue for up to £18,000, saying: 'There's a lot more to copyright than who pushes the trigger.'

The legal consensus was that not only was Dave unable to assert copyright, but neither could the monkey.

The only primates with any hope of making money out of 'the world's greatest selfie' were, inevitably, lawyers.

Two years ago, as the dispute rumbled on, the animal rights organisation People for the Ethical Treatment of Animals (PETA) launched a legal action on behalf of the monkey, which it called Naruto, claiming that it should be declared the owner of its own image. It demanded the right to manage the macaque's funds for its benefit.

PETA argued that the monkey was unable, 'due to inaccessibility and incapacity', to bring its own lawsuit. Dave says that, understandably, his lawyers treated the claim as a joke.

Sadly, it wasn't. Last year, a U.S. judge ruled against PETA, saying that animals are not covered by the Copyright Act.

He said: 'While Congress and the President can extend the protection of law to animals as well as humans, there is no indication they did so in the Copyright Act.'

Nevertheless, the organisation — which surely has countless causes more deserving of its funds — appealed against the decision. Last week, the case returned to court in San Francisco.

The arguments included such absurd issues as whether PETA has a close enough relationship to Naruto to represent it in court; the value of providing written notice of a copyright claim to a community of macaques; and whether Naruto had been harmed by not being recognised as a copyright-holder.

Dave — who had to watch proceedings online because he couldn't afford the flight to California — feels like he's going mad.

'I was being sued by a monkey. I've had nearly two years to get used to it, but it's still totally surreal,' he says.

What's more, he is convinced that PETA is championing the wrong monkey. 'He's the wrong age and sex!' He claims his monkey was female.

Dave is a naturally ebullient man who always tries to enjoy the whimsical side in life, but six years of transatlantic legal wrangling, uncertainty, frustration and online bullying have affected him deeply.

'I suffer depression and can't sleep,' he says. 'But most of all it's the sense of failure. I can't provide for my family.'

The mortgage on the modest house in Chepstow he shares with wife Jenka and seven-year-old daughter is being funded by Jenka alone.

Dave says his car has remained on the driveway for two years because he can't afford the repairs.

All because he's been forced to spend thousands on trying to protect his own work.

However, his lawyer is confident of victory and promises he'll 'sort out' the costs. 'My daughter tells everyone her daddy took the monkey selfie, but I've got nothing to give her from it.

'I can't send her to the school we want, or even think about paying her university fees when the time comes. And all could have been sorted out with one photograph.'

Most hurtfully, he's stopped taking pictures. 'The magic's gone. I get my camera out every now and again to try to recapture the joy, but I don't seem able to. This was my livelihood.

'I didn't want to make lots of money — I just wanted a fair wage for my work, something to pass on to our daughter.'

Being thrown into the world of big-shot lawyers, animals rights fanatics and online trolls has been very tough. 'I've been shamed for trying to control my own work and accused of greed,' he says. The truth is that Dave's prime love is nature.

He grew up in Bolton obsessed with animals. Every birthday and Christmas, he'd ask for books on birds or Africa. After getting five A-levels, he earned a degree and PhD in geology, and post-doctorates specialising in volcano gases.

With such qualifications, he could have earned a fortune working for oil conglomerates, but after 14 years in academia, he chose animal photography. 'I wanted to go with my heart — I wanted a stress-free life,' he says.

So he worked as a window cleaner and gardener to support himself as he honed his photography skills.

'I can sit for hours waiting patiently. It can feel spiritual.' Trips followed to the Arctic, Africa, the Philippines and Costa Rica. He dedicated his life to animal welfare — becoming an RSPB photographer and working for The Wildlife Trusts and the Wildfowl & Wetlands Trust.

But however talented you might be, life as a freelance photographer is financially unstable.

'You take thousands of images, hoping one or two will sell well enough to pay the bills and fund the next trip,' he says. And then along came the grinning macaque.

Ironically, he was a bit disappointed when he first saw the pictures.

'They were slightly underexposed and the mouth was a little out of focus,' he says.

But one frame was a belter. Within hours of uploading the image onto his website in 2011, a news agency got in touch and it was published in many newspapers, including the Daily Mail.

Soon, it went viral, appearing on social media and in blog posts. 'It was a lovely moment,' says Dave, recalling that one wag joked the monkey should be credited. Within a year, the image had earned Dave £2,500.

He hoped for a steady but small income from re-publication rights. But then it appeared on ­Wikipedia — free for all to use — and the income dried up overnight. In 2014, Dave says — perhaps with a slight exaggeration — that 'monkey selfie' was the most searched item on Google. 'It even beat Kim Kardashian!'

Yet all the exposure brought was angst. Now, after the case returned to court and continues to drag on, Dave says he's internalised most of the anger.

But he admits 'it's going to come out one day'. Having abandoned photography, he's retrained as a tennis coach and is toying with becoming a professional dog-walker. Meanwhile, he must wait another two months for the latest judgment — all the while hoping and praying that someone sees sense.

I ask if he wishes he'd never encountered that troop of rare, crested black macaques. Dave is astonished by the question. 'No, no, no!' he says.

'The photo took six years to achieve what I set out to do — to protect these monkeys. It's been worth it because that photo is the best thing that has happened to those monkeys.

Without all the attention, they'd probably be extinct now as a species. 'The locals used to roast them and eat them. Now they love them and call them 'selfie monkeys'.'